Skip to content

REV: Reverts side-effect changes to casting#16109

Merged
charris merged 1 commit intonumpy:maintenance/1.18.xfrom
seberg:revert-accidental-bool-fix
Apr 30, 2020
Merged

REV: Reverts side-effect changes to casting#16109
charris merged 1 commit intonumpy:maintenance/1.18.xfrom
seberg:revert-accidental-bool-fix

Conversation

@seberg
Copy link
Member

@seberg seberg commented Apr 29, 2020

This mostly reverts commit 6b954aa
to ensure only the longdouble floating point numbers are changed, for
which this was a bugfix was relevant.
All other numbers should be unchanged (and were faster with the change),
but revert since this is a bugfix release.

Mainly the string->boolean conversions where accidentally changed to
arguably more correct behaviour. But this should not have happend
accidentally, especially in a bug-fix branch.
Another corner case change is that string->datetime casts within
hypothetical C-extensions doing manual C-level casting was fixed to be in
line with normal string -> datetime casts (the cast was inconsistently
defined).

This revert is only applied as a backport. The second change will remain
included in the next non-bugfix release while the first is fixed in
a more specific in cleaner manner.

This mostly reverts commit 6b954aa
to ensure only the longdouble floating point numbers are changed, for
which this was a bugfix was relevant.
All other numbers should be unchanged (and were faster with the change),
but revert since this is a bugfix release.

Mainly the string->boolean conversions where accidentally changed to
arguably more correct behaviour. But this should not have happend
accidentally, especially in a bug-fix branch.
Another corner case change is that string->datetime casts within
hypothetical C-extensions doing manual C-level casting was fixed to be in
line with normal string -> datetime casts (the cast was inconsistently
defined).

This revert is only applied as a backport. The second change will remain
included in the next non-bugfix release while the first is fixed in
a more specific in cleaner manner.
@seberg seberg force-pushed the revert-accidental-bool-fix branch from 0b13628 to f6cdbfa Compare April 29, 2020 19:11
Comment on lines +1530 to +1531
* #convert = 1*14, 0, 1*3, 0*3, 1*2,
* 1*14, 0, 1*3, 0*3, 1*2,
Copy link
Member Author

Choose a reason for hiding this comment

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

@charris, this reverts the commit (except the tests). With this only longdouble is affected by the fixup, for which it fixes a bug, and is not just a bit of a jumping through hoops.

The two lines above should be the only change remaining from the original backport., i.e. the original fix effectively set convert = 0 for all types. This one only does it for longdouble.

@charris
Copy link
Member

charris commented Apr 30, 2020

Close/reopen

@charris charris closed this Apr 30, 2020
@charris charris reopened this Apr 30, 2020
@charris charris closed this Apr 30, 2020
@charris charris reopened this Apr 30, 2020
@charris charris merged commit 6586541 into numpy:maintenance/1.18.x Apr 30, 2020
@charris
Copy link
Member

charris commented Apr 30, 2020

Thanks Sebastian.

@seberg seberg deleted the revert-accidental-bool-fix branch April 30, 2020 15:27
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