Comments (4)
Generic aliases are not classes. They also don't work with isinstance()
.
from cpython.
cc @iritkatriel
from cpython.
(Sorry, I am on a train, very slow to respond)
Yes, this is very tricky. For example, should SomeError[list[str]]
be caught when SomeError[list[int]]
is expected in except
? What about SomeError[Any]
? For this feature we need isinstance()
to be able to work on generic collections. And we need to figure out how to handle this corner cases.
I am -1 on this feature.
from cpython.
yeah i wasn't expecting it to check the generic at runtime at all, i was only treating it as like a cast. but i see now that it's pretty much the same issue as isinstance
from cpython.
Related Issues (20)
- C API Extension Support for Freethreading HOWTO
- Free-threaded binary builds for 3.13
- PySequence_Fast needs new macros to be safe in a nogil world HOT 3
- Import `_ios_support` raises RuntimeError on Windows
- pyrepl: Cursor behaviour during tab-completion HOT 1
- Tier 2 Optimizer Eliminate Type Version Guards
- is_dataclass() returns True for non-dataclass subclass of dataclass HOT 5
- test_ioctl is skipped because of setsid()
- Update type checking conditions in new repl module
- `contextlib.suppress` converts instances of a subtype of `ExceptionGroup` to an instance of the `ExceptionGroup` class HOT 2
- Add job to `jit.yml` to build and test with `--disable-gil`
- Incompatibility between _decimal and _pydecimal: tp_name for Decimal
- Python float calculation error HOT 2
- IDLE: Menu fonts too small HOT 1
- `get_origin(str|None) != get_origin(Union[str,None])` HOT 4
- Break up _pyrepl tests HOT 1
- '\040' instead of space in repl history on macOS with 3.13 or main branch HOT 2
- Unexpected name mangling behavior with generics HOT 1
- Resolve deprecation warnings in Docs/tools HOT 1
- REPL cursor is rendered offset in VSCode on WSL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.