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

MAINT: Python3 classes do not need to inherit from object #2025

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Dec 23, 2021

See this Q/A for a background on class Foo(object): vs class Foo:.

In summary, only Python 2 required inheriting from object, but this is no longer necessary with Python 3 (and the docs don't use that style here or here). This PR keeps the base classes a bit tidier and quicker to identify.

Edits were automated using:

git ls-files -z | xargs -0 sed -i -re 's/class (.*)\(object\):/class \1:/g'

@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #2025 (d110fe4) into master (1d569e6) will not change coverage.
The diff coverage is 92.30%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2025   +/-   ##
=======================================
  Coverage   89.90%   89.90%           
=======================================
  Files          17       17           
  Lines        2307     2307           
=======================================
  Hits         2074     2074           
  Misses        233      233           
Impacted Files Coverage Δ
h5py/_hl/dataset.py 93.14% <66.66%> (ø)
h5py/_hl/base.py 96.18% <100.00%> (ø)
h5py/_hl/group.py 96.78% <100.00%> (ø)
h5py/_hl/selections.py 87.50% <100.00%> (ø)
h5py/_hl/selections2.py 97.61% <100.00%> (ø)
h5py/_hl/vds.py 96.55% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d569e6...d110fe4. Read the comment docs.

@takluyver takluyver closed this Jan 8, 2022
@takluyver takluyver reopened this Jan 8, 2022
@takluyver
Copy link
Member

Thanks - I'll merge this. I think the benefit is a bit borderline, though. If you're thinking of doing more cleanups, it might be worth asking before making a PR.

@takluyver takluyver merged commit aa31f03 into h5py:master Jan 8, 2022
@takluyver takluyver added this to the 3.7 milestone May 23, 2022
@mwtoews mwtoews deleted the class-wo-object branch November 24, 2022 01:56
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 this pull request may close these issues.

2 participants