File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,26 @@ version from which features were backported; for example,
42
42
``typing_extensions `` 3.10.0.0 was meant to reflect ``typing `` as of
43
43
Python 3.10.0. During this period, no changelog was maintained.
44
44
45
+ Runtime use of types
46
+ ~~~~~~~~~~~~~~~~~~~~
47
+
48
+ We aim for complete backwards compatibility in terms of the names we export:
49
+ code like ``from typing_extensions import X `` that works on one
50
+ typing-extensions release will continue to work on the next.
51
+ It is more difficult to maintain compatibility for users that introspect
52
+ types at runtime, as almost any detail can potentially break compatibility.
53
+ Users who introspect types should follow these guidelines to minimize
54
+ the risk of compatibility issues:
55
+
56
+ - Always check for both the :mod: `typing ` and ``typing_extensions `` versions
57
+ of objects, even if they are currently the same on some Python version.
58
+ Future ``typing_extensions `` releases may re-export a separate version of
59
+ the object to backport some new feature or bugfix.
60
+ - Use public APIs like :func: `get_origin ` and :func: `get_original_bases ` to
61
+ access internal information about types, instead of accessing private
62
+ attributes directly. If some information is not available through a public
63
+ attribute, consider opening an issue in CPython to add such an API.
64
+
45
65
Python version support
46
66
----------------------
47
67
You can’t perform that action at this time.
0 commit comments