-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
dis: update for py311 #7649
dis: update for py311 #7649
Conversation
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
if sys.version_info >= (3, 11): | ||
class Instruction(NamedTuple): | ||
opname: str | ||
opcode: int | ||
arg: int | None | ||
argval: Any | ||
argrepr: str | ||
offset: int | ||
starts_line: int | None | ||
is_jump_target: bool | ||
positions: Positions | None = ... | ||
|
||
else: | ||
class Instruction(NamedTuple): | ||
opname: str | ||
opcode: int | ||
arg: int | None | ||
argval: Any | ||
argrepr: str | ||
offset: int | ||
starts_line: int | None | ||
is_jump_target: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be simpler with if
statement inside the class:
if sys.version_info >= (3, 11): | |
class Instruction(NamedTuple): | |
opname: str | |
opcode: int | |
arg: int | None | |
argval: Any | |
argrepr: str | |
offset: int | |
starts_line: int | None | |
is_jump_target: bool | |
positions: Positions | None = ... | |
else: | |
class Instruction(NamedTuple): | |
opname: str | |
opcode: int | |
arg: int | None | |
argval: Any | |
argrepr: str | |
offset: int | |
starts_line: int | None | |
is_jump_target: bool | |
class Instruction(NamedTuple): | |
opname: str | |
opcode: int | |
arg: int | None | |
argval: Any | |
argrepr: str | |
offset: int | |
starts_line: int | None | |
is_jump_target: bool | |
if sys.version_info >= (3, 11): | |
positions: Positions | None = ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, at least mypy doesn't like that
No description provided.