-
Notifications
You must be signed in to change notification settings - Fork 73
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
Upgrade to Python 3.7+ syntax #234
Conversation
Codecov Report
@@ Coverage Diff @@
## master #234 +/- ##
=======================================
Coverage 99.07% 99.07%
=======================================
Files 24 24
Lines 5085 5088 +3
=======================================
+ Hits 5038 5041 +3
Misses 47 47
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. While I believe the type annotations might be fine if the future annotations are used I would prefer to ensure the mypy checks for each supported Python version still work so we might have to still use some of the older typing
constructs.
ea1f79e
to
cc0f3ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes, good to be free of some of those Python 2-isms.
pyupgrade --py37-plus ./**/*.py
to upgrade Python 2.7 syntax to 3.7+%s
and.format()
syntax with f-strings%s
string syntax, but without explicit"msg" % (variables,)
- letlogging
do this if logging is enabled for a specific level# type
comments to type hints, replaceList[type]
,Optional[type]
andUnion[type1, type2]
withlist[type]
,type | None
andtype1 | type2
(usingfrom __future__ import annotations
).os.fspath
instead ofstr
to convert Path-like objects to string path representationprint