| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I'm -1 on this fix. There is a bigger underlying issue. See #102615 (comment) |
Sorry, something went wrong.
|
I have no idea what to do here, I defer to @Fidget-Spinner. |
Sorry, something went wrong.
|
I'm now +1 on this approach after Nikita reminded me that ParamSpec intentionally has edge cases that we cant fix. |
Sorry, something went wrong.
|
This PR should be reviewed after #102681 |
Sorry, something went wrong.
|
@AlexWaygood you can review this whenever you have the time. |
Sorry, something went wrong.
There was a problem hiding this comment.
@AlexWaygood you can review this whenever you have the time.
Time, the most precious commodity of our age! Here's a review for the tests and docs :)
Sorry, something went wrong.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
There was a problem hiding this comment.
Thanks! LGTM, at least as a short-term fix.
I don't think we should backport this, as it could easily break people's doctests. Let me know if you disagree :)
Sorry, something went wrong.
| TsP[int, str, list[int], []]: "TsP[int, str, list[int], []]", | ||
| TsP[int, [str, list[int]]]: "TsP[int, [str, list[int]]]", | ||
|
|
||
| # These lines are just too long to fit: |
There was a problem hiding this comment.
😆
Sorry, something went wrong.
|
@sobolevn, should we make the same changes we made here to _collections_abc._type_repr? The docstring of that function indicates it is meant to have identical functionality to typing._type_repr. cpython/Lib/_collections_abc.py Line 515 in 51d693c |
Sorry, something went wrong.
|
In fact... I wonder if we should just import _type_repr from _collections_abc in typing, instead of duplicating it between the two modules. It's obvious why _collections_abc shouldn't depend on typing, but I don't see any reason why typing shouldn't depend on _collections_abc. We already have import collections.abc at the top of the file. |
Sorry, something went wrong.
|
@AlexWaygood I thought about making the similar change in _collections_abc._type_repr. But, what is the use-case? Right now users can define their own classes with ParamSpec only using typing.Generic. So, no use for _collections_abc. Any examples where this might be useful? I also think that sharing implementation details (functions starting with _) creates high coupling and implicit contracts, which is bad thing. |
Sorry, something went wrong.
|
Okay, those are all good points. I think it might be nice at least to update the docstring of typing._type_repr to remind us that there's a function with very similar functionality in _collections_abc, though. What do you think? |
Sorry, something went wrong.
|
I will! |
Sorry, something went wrong.
…python#102637) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…python#102637) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.