X Tutup
The Wayback Machine - https://web.archive.org/web/20221208174224/https://github.com/python/cpython/issues/99281
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

csv assumes that there are builds without complex #99281

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

csv assumes that there are builds without complex #99281

sobolevn opened this issue Nov 9, 2022 · 1 comment
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Nov 9, 2022

These lines assume that there might be NameError in some cases while accessing complex:

cpython/Lib/csv.py

Lines 168 to 172 in 0124b5d

# Guard Sniffer's type checking against builds that exclude complex()
try:
complex
except NameError:
complex = float

I don't think that it is true today (the code itself is 20 years old).
Now complex is a documented part of the builtins. If it is missing, half of the stdlib will be broken.

I've sent the PR with the removal of these lines.

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Nov 9, 2022
@sobolevn sobolevn self-assigned this Nov 9, 2022
sobolevn added a commit to sobolevn/cpython that referenced this issue Nov 9, 2022
@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
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants
X Tutup