-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
class A(1, 2, 3, **d): pass
gives bad bytecode
#90319
Comments
Please refer to #30235 |
Bisected to here: 13bc139 is the first bad commit
In debug mode, the following code gives fails a C-level assertion: d = {'metaclass': type}
for _ in [1]:
class A(1, 2, 3, **d):
pass Assertion failed: b->b_startdepth < 0 || b->b_startdepth == depth, file compile.c, line 6959 |
class A(1, 2, 3, **d): pass
gives bad bytecode
I was trying to figure out how code like this could ever not raise an exception, and here is one case that runs to completion on 3.6--3.8, but it raises class I(int):
def __init__(*args, **kwargs): pass
def __new__(*args, **kwargs): pass
d = {'metaclass': I}
class A(1, 2, 3, **d):
pass |
Qiang Zhang, thanks for fixing this. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: