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

add Integer traitlet #996

Closed
wants to merge 1 commit into from
Closed

add Integer traitlet #996

wants to merge 1 commit into from

Conversation

minrk
Copy link
Member

@minrk minrk commented Nov 13, 2011

Most Int traits are now Integers

Integer differs from Long only in that small longs are cast to int, rather than
all ints being cast to long:

Integer(4L) => 4
Long(4) => 4L

closes gh-942

Most int traits are now Integers

Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:

    Integer(4L) => 4
    Long(4) => 4L

closes ipythongh-942
@takluyver
Copy link
Member

Looks OK to me. I haven't tested in Python 3, but from what I know 2to3 does, it should work (it just becomes effectively the same as Int).

@minrk
Copy link
Member Author

minrk commented Nov 14, 2011

The Integer traitlet is defined inside the same if not py3compat.PY3 block as Long, so Int is Integer on Python 3.

@takluyver
Copy link
Member

Oh yes, I'd missed that.

@fperez fperez closed this Nov 20, 2011
@fperez
Copy link
Member

fperez commented Nov 20, 2011

Looks good. Rebased and merged in 293d3ee. Thanks!

stefanv pushed a commit to stefanv/ipython that referenced this pull request Nov 30, 2011
Most int traits are now Integers

Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:

    Integer(4L) => 4
    Long(4) => 4L

closes ipythongh-942, closes ipythongh-996.

Rebased to avoid recursive merge for just one commit.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Most int traits are now Integers

Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:

    Integer(4L) => 4
    Long(4) => 4L

closes ipythongh-942, closes ipythongh-996.

Rebased to avoid recursive merge for just one commit.
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.

number traits should cast if value doesn't change
3 participants