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

Python 3.10 improvements #1139

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Python 3.10 improvements #1139

wants to merge 2 commits into from

Conversation

hugsy
Copy link
Owner

@hugsy hugsy commented Sep 24, 2024

Description

Follow-up PR for #1133

Cleans up the code to make it more in comformance with Python 3.10 capabilities.

@hugsy hugsy added this to the 2024.09 milestone Sep 24, 2024
@hugsy hugsy self-assigned this Sep 24, 2024
Copy link

🤖 Coverage update for cde95b3 🟢

Old New
Commit f298b7f cde95b3
Score 71.6267% 71.6267% (0)

assert res
groups = [int(d) for d in res.groups()]
assert len(groups) == 2
return (groups[0], groups[1])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return (groups[0], groups[1])
return groups[0], groups[1]

self.commands : Dict[str, GenericCommand] = collections.OrderedDict()
self.functions : Dict[str, GenericFunction] = collections.OrderedDict()
self.missing: Dict[str, Exception] = {}
self.commands : dict[str, GenericCommand] = collections.OrderedDict()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we not need ordered dicts anymore?

gef.py Show resolved Hide resolved
@@ -11063,7 +11071,7 @@ def selected_arena(self, value: GlibcArena) -> None:
return

@property
def arenas(self) -> Union[List, Iterator[GlibcArena]]:
def arenas(self) -> list | Iterator[GlibcArena]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use | I think there are many more cases where we can get rid of Union

gef.py Show resolved Hide resolved
gef.py Show resolved Hide resolved
gef.py Show resolved Hide resolved
gef.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants