Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate non-essential TraitHandler subclasses for 6.0 release? #697

Closed
mdickinson opened this issue Jan 3, 2020 · 6 comments · Fixed by #770
Closed

Deprecate non-essential TraitHandler subclasses for 6.0 release? #697

mdickinson opened this issue Jan 3, 2020 · 6 comments · Fixed by #770
Assignees
Milestone

Comments

@mdickinson
Copy link
Member

mdickinson commented Jan 3, 2020

Here's the complete list of TraitHandler subclasses in current master.

>>> from traits.api import TraitHandler
>>> for cls in TraitHandler.__subclasses__(): print(cls.__name__)
... 
TraitCoerceType
ThisClass
TraitClass
TraitFunction
TraitEnum
TraitPrefixList
TraitMap
TraitExpression
TraitCompound
TraitTuple
TraitCallable
TraitList
TraitDict

Some of these are still central to Traits itself, like TraitCoerceType and TraitCompound. Others, like TraitList and TraitDict aren't needed by either Traits or by new code, and are largely unused in projects - the major uses are in other ETS libraries (apptools, pyface, mayavi).

I'm considering deprecating the less essential classes in Traits 6.0.0. A deprecation warning could be issued at instantiation time.


Update: TraitCallable is gone in #698. TraitExpression is removed in #699. TraitClass is removed in #710.

@mdickinson
Copy link
Member Author

And for some of these classes, we may be able to simply remove them. TraitCallable appears to fit into this category.

@mdickinson mdickinson added this to the 6.0.0 release milestone Jan 3, 2020
@mdickinson
Copy link
Member Author

TraitExpression can also go. TraitThis is used only in ListThis (which is itself deprecated), and nowhere else in ETS; I think both TraitThis and ListThis could safely be removed.

Everything else is either used by the general Trait machinery, or is used elsewhere in ETS.

@mdickinson
Copy link
Member Author

TraitThis

Sorry; I meant ThisClass. And unfortunately, TraitInstance subclasses ThisClass (somewhat randomly), and TraitInstance is used fundamentally by the Traits machinery.

@mdickinson
Copy link
Member Author

TraitClass is removed in #711

@corranwebster
Copy link
Contributor

ListThis was modified so that it doesn't use ThisClass in #730. It should be fairly easy to make TraitInstance inherit directly from TraitHandler by copying any code that is used from ThisClass and then ThisClass can be deprecated.

@mdickinson
Copy link
Member Author

mdickinson commented Jan 21, 2020

After a slew of PRs, the current status, and likely the Traits 6.0 status is:

Subclasses still present:

TraitCoerceType
TraitInstance
TraitFunction
TraitEnum
TraitPrefixList
TraitMap
TraitPrefixMap (subclass of TraitMap)
TraitCompound

Subclasses deprecated:

TraitTuple
TraitList
TraitDict

Subclasses removed in the Traits 6.0 release:

TraitRange
TraitString
ThisClass
TraitClass
TraitExpression
TraitCallable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants