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

bpo-29602: fix signed zero handling in complex constructor. #203

Merged
merged 2 commits into from Feb 20, 2017

Conversation

mdickinson
Copy link
Member

@mdickinson mdickinson commented Feb 20, 2017

This PR, based on a patch by Serhiy Storchaka, fixes the issues with signed zeros identified in http://bugs.python.org/issue29602:

  • given a class class A(object) implementing __complex__, complex(A()) ignored the sign of a negative zero in the imaginary part
  • given a subclass class C(complex), construction of a C instance from a complex instance also ignored the sign of a negative zero in the imaginary part.

@mdickinson mdickinson added type-bug An unexpected behavior, bug, or error needs backport to 2.7 labels Feb 20, 2017
@mdickinson mdickinson merged commit 112ec38 into python:master Feb 20, 2017
@mdickinson mdickinson deleted the fix/complex-subclass-zeros branch Feb 20, 2017
mdickinson added a commit to mdickinson/cpython that referenced this pull request Feb 20, 2017
* Fix incorrect handling of signed zeros for complex-related classes.

* Add Misc/NEWS entry.

(cherry picked from commit 112ec38)
mdickinson added a commit to mdickinson/cpython that referenced this pull request Feb 20, 2017
* Fix incorrect handling of signed zeros for complex-related classes.

* Add Misc/NEWS entry.

(cherry picked from commit 112ec38)
mdickinson added a commit that referenced this pull request Feb 20, 2017
)

* Fix incorrect handling of signed zeros for complex-related classes.

* Add Misc/NEWS entry.

(cherry picked from commit 112ec38)
mdickinson added a commit that referenced this pull request Feb 20, 2017
)

* Fix incorrect handling of signed zeros for complex-related classes.

* Add Misc/NEWS entry.

(cherry picked from commit 112ec38)
akruis pushed a commit to akruis/cpython that referenced this pull request Jan 6, 2019
akruis pushed a commit to akruis/cpython that referenced this pull request Jan 12, 2019
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants