-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add the rest of string.Template's class attributes #6109
Conversation
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm not sure what the cause is, but any importing of the |
This comment has been minimized.
This comment has been minimized.
That's extremely weird. It does appear to be a genuine mistake in the markdown stubs, but I do not see why this change is at all related. @JelleZijlstra any idea what's going on? |
Surfaced weirdly by python#6109
Maybe #6115 will help :-) |
Surfaced weirdly by #6109 Co-authored-by: hauntsaninja <>
stdlib/string.pyi
Outdated
@@ -1,4 +1,5 @@ | |||
from typing import Any, Iterable, Mapping, Sequence, Tuple | |||
# from re import RegexFlag # Importing from regex breaks the Markdown stubtest | |||
from typing import Any, Iterable, Mapping, Pattern, Sequence, Tuple |
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.
That's hopefully fixed now if you merge in master. Also, Pattern
should be imported from re
, not typing
.
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.
Done
8fc71e8
to
e622c68
Compare
Appreciate the help, I've rebased from master and took the opportunity to clean up the commits. I'll admit I still don't understand how import |
This comment has been minimized.
This comment has been minimized.
I also can't explain the |
Diff from mypy_primer, showing the effect of this PR on open source code: poetry (https://github.com/python-poetry/poetry.git)
- poetry/plugins/plugin_manager.py:22: error: Need type annotation for "_plugins" (hint: "_plugins: List[<type>] = ...")
+ poetry/mixology/failure.py:144: error: Item "RootCause" of "Union[RootCause, NoVersionsCause, DependencyCause, ConflictCause, PythonCause, PlatformCause, PackageNotFoundCause]" has no attribute "conflict"
|
if sys.version_info >= (3, 8): | ||
from re import Pattern | ||
else: | ||
from typing import Pattern |
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.
I just noticed that Pattern
is not re-exported from re
in Python 3.6. My mistake.
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.
The primer report hints at a real problem with poetry.
Awesome, thanks for your contribution and for working through the several (some mysterious) issues! |
I wouldn't say I "worked through them", but rather "did nothing and had others fix the problem for me" :) Once again appreciate the reviews and help on this. Cheers. |
Adds the following attributes to
string.Template
.Also just wanted to say thanks for the fantastic Good ways to contribute issue.