Skip to content

MAINT: Separate correct longdouble.__float__ from incorrect longdouble.__int__ - #9967

Merged
charris merged 1 commit into
numpy:masterfrom
eric-wieser:separate-longdouble-int
Nov 6, 2017
Merged

charris merged 1 commit into
numpy:masterfrom
eric-wieser:separate-longdouble-int

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Nov 5, 2017 •

Copy link
Copy Markdown
Member

These barely shared any useful code at all, and it makes it clearer where the fix needs to go for #9964

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.

Using PyArrayScalar_VAL in favor of this

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 repeat is way clearer expressed as two repeats

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 is where things need to change to fix #9964, but lets leave that to a future PR.

@eric-wieser eric-wieser Nov 5, 2017 •

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 is deliberate, as nb_int should try to return int on py2, but long on py3. I'm not sure it makes a difference externaly (I suspect python deals with either return value), but it's more consistent with how longobject is implemented.

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.

It's far more readable and concise to iterate over the types here, rather than the members.

…uble.__int__`

These barely shared any useful code at all.
@eric-wieser
eric-wieser force-pushed the separate-longdouble-int branch from 49c624a to 7b4ec2a Compare November 5, 2017 23:26
@charris
charris merged commit ece0c5d into numpy:master Nov 6, 2017
@charris

charris commented Nov 6, 2017

Copy link
Copy Markdown
Member

Thanks Eric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants