Skip to content

Use simplified super() calling in classes #432

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

Closed
soulee-dev opened this issue Aug 23, 2023 · 0 comments · Fixed by #433
Closed

Use simplified super() calling in classes #432

soulee-dev opened this issue Aug 23, 2023 · 0 comments · Fixed by #433

Comments

@soulee-dev
Copy link
Contributor

soulee-dev commented Aug 23, 2023

Issue Description

With the introduction of Python 3, the super() function can be called without any arguments in instance methods, automatically determining the class and self. This helps in making the code cleaner and more maintainable.

Current Code

The current usage of super() in the classes is as follows:

super(ClassName, self).__init__(from_packet, event_size, table_map)

Proposed Change

The new and more concise usage, available from Python 3 onwards, should be applied:

super().__init__(from_packet, event_size, table_map)

Benefits

  • Code readability: Simplifying the call to super() makes the code easier to read.
  • Code maintainability: If the class name changes in the future, you won't have to update the call to super().

Suggested Implementation

I can make a pull request implementing these changes across the codebase, if that's acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant