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

Take some of the magic out of traits by insisting traits be instances, not classes #51

Merged
merged 1 commit into from
Jul 23, 2015

Conversation

jasongrout
Copy link
Member

As Sylvain proposed in #48,

class Foo(HasTraits):
    bar = Int    # deprecated
    baz = Int()  # ok
    alpha = List(trait=Int)     # deprecated
    alpha = List(trait=Int())   # ok

@jasongrout
Copy link
Member Author

This will require quite a few changes to other repos, because things like List(Unicode, ...) are used a lot throughout IPython.

@@ -64,7 +64,8 @@
#-----------------------------------------------------------------------------
# Basic classes
#-----------------------------------------------------------------------------

import warnings
warnings.filterwarnings('error')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line, changing warnings to errors, should be removed for the final version of this PR. This just makes it really easy to see where things break.

@SylvainCorlay
Copy link
Member

Jason reviews his own pull requests :)

I am 👍 on this change. This deprecates half of the code of the metaclass.

@jasongrout
Copy link
Member Author

Hey, I write them with my right brain, I review them with my left!

@minrk minrk modified the milestones: 5.0, 4.1 Jul 16, 2015
@jasongrout
Copy link
Member Author

Yes, I think the deprecation should happen in 4.1, removal in 5.0

@minrk
Copy link
Member

minrk commented Jul 16, 2015

Sounds good.

@ellisonbg
Copy link
Member

I am +1 on this change.

On Thu, Jul 16, 2015 at 3:11 PM, Min RK notifications@github.com wrote:

Sounds good.


Reply to this email directly or view it on GitHub
#51 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com

@jasongrout jasongrout force-pushed the instances branch 2 times, most recently from 361e7f6 to e9959b2 Compare July 20, 2015 18:58
@jasongrout
Copy link
Member Author

I think this (and the related commits in different repos noted above) are ready for review now.

@jasongrout jasongrout changed the title IN-PROGRESS Take some of the magic out of traits by insisting traits be instances, not classes Take some of the magic out of traits by insisting traits be instances, not classes Jul 20, 2015
@jasongrout
Copy link
Member Author

ping on merging this. Because both this and the metadata PR change the same lines when upgrading our code, I'd like to base the metadata pr on this one, and that's easier if this is merged into master.

minrk added a commit that referenced this pull request Jul 23, 2015
Take some of the magic out of traits by insisting traits be instances, not classes
@minrk minrk merged commit 684b5fa into ipython:master Jul 23, 2015
@SylvainCorlay
Copy link
Member

cool!

@jasongrout jasongrout deleted the instances branch July 24, 2015 00:03
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 this pull request may close these issues.

None yet

4 participants