| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…untime_checkable`
There was a problem hiding this comment.
Makes sense.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for doing this! Had one suggestion for a different example of attribute
Sorry, something went wrong.
|
|
||
| assert isinstance(open('/some/file'), Closable) | ||
|
|
||
| @runtime_checkable |
There was a problem hiding this comment.
I think many users aren't too familiar with OSError's constructor / we can't use kwargs and it's unclear what the second argument is. Maybe we could use int and HasNumerator instead?
(I know it's not writeable, but OSError's errno also is maybe not writeable? Writing to errno doesn't affect repr)
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, I was really struggling to think of a good example for this! I'll ponder some more and see if I can come up with something better...
Sorry, something went wrong.
There was a problem hiding this comment.
Perhaps unsurprisingly, not too many good cases of writeable attributes in stdlib. Maybe Thread.name? It's explicitly documented as something you can write to.
Sorry, something went wrong.
There was a problem hiding this comment.
That works! I'll make the change tomorrow (it's late here)
Sorry, something went wrong.
|
Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
…ecorated with `@runtime_checkable` (pythonGH-102937) (cherry picked from commit 58d2b30) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-102963 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
…ecorated with `@runtime_checkable` (pythonGH-102937) (cherry picked from commit 58d2b30) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-102964 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
|
Thanks all for the reviews! |
Sorry, something went wrong.
…ecorated with `@runtime_checkable` (python#102937)
…ecorated with `@runtime_checkable` (python#102937)
| 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.