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

test_complex contains tests for old-style classes #99320

Closed
sobolevn opened this issue Nov 10, 2022 · 1 comment
Closed

test_complex contains tests for old-style classes #99320

sobolevn opened this issue Nov 10, 2022 · 1 comment
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Nov 10, 2022

class OS:
def __init__(self, value): self.value = value
def __complex__(self): return self.value
class NS(object):
def __init__(self, value): self.value = value
def __complex__(self): return self.value
self.assertEqual(complex(OS(1+10j)), 1+10j)
self.assertEqual(complex(NS(1+10j)), 1+10j)

Right now there are "old-style classes". It should be removed.
PR is on its way.

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Nov 10, 2022
@sobolevn sobolevn self-assigned this Nov 10, 2022
sobolevn added a commit to sobolevn/cpython that referenced this issue Nov 10, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 10, 2022
…ythonGH-99321)

(cherry picked from commit 26726c7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 10, 2022
…ythonGH-99321)

(cherry picked from commit 26726c7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this issue Nov 10, 2022
)

(cherry picked from commit 26726c7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this issue Nov 10, 2022
)

(cherry picked from commit 26726c7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@AlexWaygood
Copy link
Member

AlexWaygood commented Nov 10, 2022

Thanks @sobolevn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants