Comments (3)
The general aim is to reflect the behavior on most recent CPython, regardless of the Python version where typing-extensions is run. We're less likely to backport if:
- The changed behavior is very obscure
- The behavior only affects versions that are about to go EOL (e.g., at this point I wouldn't be enthusiastic about backporting a fix that only affects 3.8)
- The fix in typing-extensions would be very invasive
In this case, the behavior isn't all that obscure and it affects versions that still have a few years of life in them, so I'd be willing to accept it as long as it doesn't get too complex. I'm OK with copying over more of get_type_hints
if that's what it takes.
from typing_extensions.
The above PR represents a very bruteforce approach, namely in that it's not clear to me how to arrive at parity to the old, seeming much simpler, mechanism without first copying the whole implementation of get_type_hints
, which then cascades through ForwardRef
, a number of supporting functions.
Although at the same time, I noticed a number of potentially public-facing difference with ForwardRef
itself.
The fact that typing
is the way it is, and is as version specific as it is seems rather sad tbh.
from typing_extensions.
I'm thinking this issue is what has been causing some issues using fastapi between 3.11 and versions below it; is there desire to have more discussion/move this forward a bit?
from typing_extensions.
Related Issues (20)
- PEP-696: `AttributeError: attribute '__default__' of 'typing.ParamSpec' objects is not writable` on Python 3.13 HOT 4
- ParamSpec `_set_default` called from `ParamSpec.__new__` raises Attribute Error HOT 2
- Add an `override` decorator to a .pyi file HOT 8
- Add `inspect.get_annotations` backport
- Add `typing.get_type_hints` backport HOT 1
- Pylint raises error saying "default" isn't valid for TypeVar HOT 2
- Third-party tests failed on Sat Jun 01 2024 HOT 2
- `TypeError` on nested `Annotated`s with `typing_extensions==4.12.0`
- Third-party tests failed on Sun Jun 02 2024 HOT 2
- 4.12.1: `pyupgrade --py38-plus` generated patch causes pytest fails HOT 9
- Third-party tests failed on Mon Jun 03 2024 HOT 1
- Third-party tests failed on Thu Jun 06 2024 HOT 1
- Weird conflict between typing-extensions 4.12.1, xarray, dirty_equals on Python 3.8 HOT 2
- 4.12.2 creates an import bug HOT 2
- Add `typing_extensions.TypeExpr` HOT 4
- Third-party tests failed on Wed Jun 26 2024 HOT 1
- Third-party tests failed on Sat Jul 13 2024 HOT 1
- Third-party tests failed on Sun Jul 14 2024 HOT 3
- Third-party tests failed on Mon Jul 15 2024 HOT 1
- `typing_extensions.deprecated` and `warnings.deprecated` remove coroutine property; How to deprecate async functions? HOT 4
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 typing_extensions.