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

Modernize abc stdlib usage. #7928

Merged
merged 2 commits into from Jun 22, 2019
Merged

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Jun 21, 2019

Eliminate use of the deprecated abc.abstractproperty. See:
https://docs.python.org/3/library/abc.html#abc.abstractproperty

While in meta.py also simplify the Singleton baseclass.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

🐍🎉

Singleton = SingletonMetaclass(u'Singleton', (object,), {})
except TypeError: # Python2
Singleton = SingletonMetaclass(b'Singleton', (object,), {})
Singleton = SingletonMetaclass('Singleton', (object,), {})
Copy link
Contributor

Choose a reason for hiding this comment

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

This change makes me very happy :)

@jsirois jsirois force-pushed the abcs/fix_deprecated branch 2 times, most recently from a7d84af to 91a968c Compare June 22, 2019 16:27
@Eric-Arellano
Copy link
Contributor

This is certain to have merge conflicts with #7926, which I'm planning to merge upon green CI in an hour or so.

Eliminate use of the `deprecated abc.abstractproperty`. See:
  https://docs.python.org/3/library/abc.html#abc.abstractproperty

While in meta.py also simplify the `Singleton` baseclass and simplify
the now redundant `AbstractClass` to alias `abc.ABC` with inlining
tracked by pantsbuild#7927.
@jsirois jsirois merged commit 057fda3 into pantsbuild:master Jun 22, 2019
@jsirois jsirois deleted the abcs/fix_deprecated branch June 22, 2019 22:03
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.

None yet

2 participants