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

MNT: switch from python2 style super() calls to python3 #1202

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nstelter-slac
Copy link
Collaborator

@nstelter-slac nstelter-slac commented Mar 15, 2025

The background on this patch is that running on pyside6 exposes some weirdness which how we are doing super() __init__ calls, so this it comes as some cleanup before another fix that will follow.

these calls are equivalent (in python3):
python2 style: super(ClassName, self).__init__()
python3 style: super().__init__()

While these python2 style calls work on python3, the new way is cleaner and imo it's best to follow python3's conventions as we officially don't support python2.

references:
https://docs.python.org/3/library/functions.html#super
https://stackoverflow.com/a/19776143

@nstelter-slac nstelter-slac force-pushed the use_python3_super_calls branch from 5b3d13e to 1041426 Compare March 15, 2025 03:21
The background on this patch is that running on pyside6 exposes some weirdness which how we are doing super() __init__ calls, so this it comes as some cleanup before another fix that will follow.

python2 style: super(ClassName, self).__init__()
python3 style: super().__init__()

While these python2 style calls work on python3, the new way is cleaner and imo it's best to follow python3's conventions as we officially don't support python2.

references:
https://docs.python.org/3/library/functions.html#super
https://stackoverflow.com/a/19776143
@nstelter-slac nstelter-slac force-pushed the use_python3_super_calls branch from 1041426 to b9338a5 Compare March 15, 2025 03:25
@nstelter-slac nstelter-slac added the pyside6 for adding pyside6 (qt6) support label Mar 15, 2025
@nstelter-slac nstelter-slac changed the title MNT: switch away from python2 style super calls to python3 MNT: switch from python2 style super calls to python3 Mar 15, 2025
@nstelter-slac nstelter-slac changed the title MNT: switch from python2 style super calls to python3 MNT: switch from python2 style super() calls to python3 Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pyside6 for adding pyside6 (qt6) support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant