Skip to content

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

Merged
minrk merged 1 commit into
ipython:masterfrom
jasongrout:instances
Jul 23, 2015
Merged

Take some of the magic out of traits by insisting traits be instances, not classes#51
minrk merged 1 commit into
ipython:masterfrom
jasongrout:instances

Conversation

@jasongrout

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

Comment thread traitlets/traitlets.py Outdated

Copy link
Copy Markdown
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
Copy Markdown
Member

Jason reviews his own pull requests :)

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

@jasongrout

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

@minrk

minrk commented Jul 16, 2015

Copy link
Copy Markdown
Member

Sounds good.

@ellisonbg

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants