py2docfx 0.1.16rc2051518__py3-none-any.whl → 0.1.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py2docfx/docfx_yaml/miss_reference.py +1 -1
- py2docfx/docfx_yaml/parameter_utils.py +58 -6
- py2docfx/docfx_yaml/tests/roots/test-translator-typing/code_with_typing.py +14 -0
- py2docfx/docfx_yaml/tests/roots/test-translator-typing/conf.py +18 -0
- py2docfx/docfx_yaml/tests/test_translator_typing.py +39 -0
- py2docfx/docfx_yaml/utils.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/babel/py.typed +1 -0
- py2docfx/venv/basevenv/Lib/site-packages/certifi/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/certifi/core.py +1 -32
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/cli/__main__.py +62 -2
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/constant.py +17 -0
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/legacy.py +1 -3
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/md.py +19 -14
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/utils.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/version.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/markupsafe/_speedups.pyi +1 -0
- py2docfx/venv/basevenv/Lib/site-packages/markupsafe/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/packaging/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_elffile.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_manylinux.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_parser.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/_tokenizer.py +5 -4
- py2docfx/venv/basevenv/Lib/site-packages/packaging/licenses/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/packaging/markers.py +53 -22
- py2docfx/venv/basevenv/Lib/site-packages/packaging/metadata.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/packaging/specifiers.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/packaging/tags.py +39 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/chardet/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/pyparsing/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/tenacity/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/tomli/py.typed +1 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pip/py.typed +4 -0
- py2docfx/venv/basevenv/Lib/site-packages/pkg_resources/__init__.py +6 -7
- py2docfx/venv/basevenv/Lib/site-packages/pkg_resources/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/pygments/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/pygments/lexers/_sql_builtins.py +106 -0
- py2docfx/venv/basevenv/Lib/site-packages/pygments/lexers/scripting.py +5 -3
- py2docfx/venv/basevenv/Lib/site-packages/pygments/lexers/sql.py +24 -118
- py2docfx/venv/basevenv/Lib/site-packages/requests/__version__.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/requests/compat.py +12 -0
- py2docfx/venv/basevenv/Lib/site-packages/requests/models.py +3 -1
- py2docfx/venv/basevenv/Lib/site-packages/requests/utils.py +6 -16
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/__init__.py +0 -38
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_discovery.py +33 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/command/config.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_unix.py +63 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +5 -6
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_entry_points.py +4 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_normalization.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_path.py +12 -3
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_reqs.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_scripts.py +361 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_shutil.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/importlib_metadata/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/inflect/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/jaraco/collections/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/jaraco/functools/__init__.pyi +125 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/jaraco/functools/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.pyi +2 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi +709 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/more_itertools/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi +136 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/packaging/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/platformdirs/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/tomli/py.typed +1 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/_vendor/typeguard/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/build_meta.py +25 -37
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/bdist_egg.py +9 -11
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/bdist_wheel.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/build_ext.py +29 -28
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/develop.py +39 -179
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/easy_install.py +17 -2352
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/editable_wheel.py +14 -31
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/egg_info.py +0 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/install.py +3 -55
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/install_scripts.py +5 -11
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/command/sdist.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/compat/py310.py +11 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/dist.py +10 -12
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/installer.py +34 -29
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/contexts.py +0 -14
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/fixtures.py +235 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/integration/test_pbr.py +20 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_build_meta.py +0 -24
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_develop.py +1 -64
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_dist.py +2 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_dist_info.py +0 -63
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_editable_install.py +15 -41
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_egg_info.py +3 -2
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_scripts.py +12 -0
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_wheel.py +12 -36
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_windows_wrappers.py +3 -4
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/wheel.py +49 -24
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/__init__.py +6 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/arabic_stemmer.py +798 -797
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/armenian_stemmer.py +212 -213
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/basestemmer.py +20 -54
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/basque_stemmer.py +202 -228
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/catalan_stemmer.py +370 -375
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/danish_stemmer.py +63 -61
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/dutch_porter_stemmer.py +466 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/dutch_stemmer.py +1217 -343
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/english_stemmer.py +295 -264
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/esperanto_stemmer.py +588 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/estonian_stemmer.py +850 -0
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/finnish_stemmer.py +144 -143
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/french_stemmer.py +308 -246
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/german_stemmer.py +224 -167
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/greek_stemmer.py +1314 -1313
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/hindi_stemmer.py +39 -38
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/hungarian_stemmer.py +231 -256
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/indonesian_stemmer.py +61 -64
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/irish_stemmer.py +101 -106
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/italian_stemmer.py +272 -272
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/lithuanian_stemmer.py +233 -240
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/nepali_stemmer.py +108 -134
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/norwegian_stemmer.py +108 -63
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/porter_stemmer.py +101 -108
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/portuguese_stemmer.py +241 -250
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/romanian_stemmer.py +332 -296
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/russian_stemmer.py +178 -179
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/serbian_stemmer.py +2331 -2332
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/spanish_stemmer.py +254 -259
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/swedish_stemmer.py +143 -70
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/tamil_stemmer.py +638 -1491
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/turkish_stemmer.py +326 -292
- py2docfx/venv/basevenv/Lib/site-packages/snowballstemmer/yiddish_stemmer.py +245 -246
- py2docfx/venv/basevenv/Lib/site-packages/sphinx/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/sphinxcontrib/applehelp/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/sphinxcontrib/htmlhelp/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/sphinxcontrib/qthelp/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/sphinxcontrib/serializinghtml/py.typed +0 -0
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/_version.py +9 -4
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/connection.py +87 -38
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/contrib/emscripten/fetch.py +20 -0
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/contrib/emscripten/response.py +8 -16
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/contrib/pyopenssl.py +10 -0
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/exceptions.py +12 -4
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/http2/connection.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/poolmanager.py +17 -1
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/py.typed +2 -0
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/response.py +53 -24
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/util/request.py +12 -4
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/util/ssl_.py +22 -2
- py2docfx/venv/basevenv/Lib/site-packages/urllib3/util/ssl_match_hostname.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/wheel/__init__.py +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/wheel/__main__.py +7 -5
- py2docfx/venv/{venv1/Lib/site-packages/wheel/cli → basevenv/Lib/site-packages/wheel/_commands}/__init__.py +3 -5
- py2docfx/venv/{venv1/Lib/site-packages/wheel/cli → basevenv/Lib/site-packages/wheel/_commands}/convert.py +14 -9
- py2docfx/venv/{venv1/Lib/site-packages/wheel/cli → basevenv/Lib/site-packages/wheel/_commands}/pack.py +1 -2
- py2docfx/venv/basevenv/Lib/site-packages/wheel/{cli → _commands}/tags.py +4 -3
- py2docfx/venv/basevenv/Lib/site-packages/wheel/_metadata.py +184 -0
- py2docfx/venv/basevenv/Lib/site-packages/wheel/bdist_wheel.py +12 -23
- py2docfx/venv/basevenv/Lib/site-packages/wheel/macosx_libfile.py +4 -0
- py2docfx/venv/basevenv/Lib/site-packages/wheel/metadata.py +17 -183
- py2docfx/venv/basevenv/Lib/site-packages/wheel/wheelfile.py +30 -16
- py2docfx/venv/venv1/Lib/site-packages/azure/core/_version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/credentials.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/azure/core/instrumentation.py +67 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/_base.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/_base_async.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/_tools.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_authentication.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_authentication_async.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_distributed_tracing.py +152 -29
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_redirect.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_redirect_async.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_retry.py +3 -10
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_retry_async.py +3 -8
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_universal.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/transport/_aiohttp.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/transport/_base_async.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/transport/_requests_asyncio.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/polling/base_polling.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/azure/core/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/rest/_aiohttp.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/rest/_http_response_impl_async.py +3 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/rest/_requests_asyncio.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/rest/_rest_py3.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/settings.py +27 -21
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/__init__.py +3 -7
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/_abstract_span.py +2 -35
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/_models.py +71 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/common.py +12 -4
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/decorator.py +66 -13
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/decorator_async.py +62 -23
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/ext/opencensus_span/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/tracing/opentelemetry.py +256 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_connection_string_parser.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_messaging_shared.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_pipeline_transport_rest_shared.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_pipeline_transport_rest_shared_async.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/core/utils/_utils.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_constants.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/default.py +23 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/environment.py +12 -16
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/service_fabric.py +22 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/user_password.py +10 -6
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/vscode.py +13 -4
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/auth_code_redirect_handler.py +3 -5
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/msal_client.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_persistent_cache.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azd_cli.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azure_cli.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azure_powershell.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/chained.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/default.py +22 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/environment.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/service_fabric.py +17 -1
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/vscode.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/certifi/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/certifi/core.py +1 -32
- py2docfx/venv/venv1/Lib/site-packages/certifi/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/cli/__main__.py +62 -2
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/constant.py +17 -0
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/legacy.py +1 -3
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/md.py +19 -14
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/utils.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/__about__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/__init__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/fernet.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/_oid.py +35 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/backends/openssl/backend.py +33 -10
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +9 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/openssl/binding.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +5 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +4 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/_serialization.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +47 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +16 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +14 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +14 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +14 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +6 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/base.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +18 -18
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/hashes.py +5 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +4 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +7 -4
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/padding.py +7 -121
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +21 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +48 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +68 -18
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/cryptography/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/utils.py +15 -3
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/__init__.py +3 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/base.py +39 -6
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/extensions.py +100 -49
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/name.py +27 -15
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/ocsp.py +60 -25
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/oid.py +2 -0
- py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/verification.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/annotations_pb2.pyi +24 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/auth_pb2.pyi +120 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/backend_pb2.pyi +102 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/billing_pb2.pyi +50 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/client_pb2.pyi +405 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/config_change_pb2.pyi +65 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/consumer_pb2.pyi +62 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/context_pb2.pyi +60 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/control_pb2.pyi +43 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/distribution_pb2.pyi +144 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/documentation_pb2.pyi +86 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/endpoint_pb2.pyi +41 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/error_reason_pb2.pyi +90 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/field_behavior_pb2.pyi +45 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/field_info_pb2.pyi +60 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/http_pb2.pyi +94 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/httpbody_pb2.pyi +41 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/label_pb2.pyi +47 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/launch_stage_pb2.pyi +40 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/log_pb2.pyi +47 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/logging_pb2.pyi +57 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/metric_pb2.pyi +186 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/monitored_resource_pb2.pyi +104 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/monitoring_pb2.pyi +57 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/policy_pb2.pyi +57 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/quota_pb2.pyi +116 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/resource_pb2.pyi +93 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/routing_pb2.pyi +49 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/service_pb2.pyi +170 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/source_info_pb2.pyi +34 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/system_parameter_pb2.pyi +60 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/usage_pb2.pyi +55 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api/visibility_pb2.pyi +56 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/bidi.py +17 -4
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/client_info.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/gapic_v1/client_info.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/py.typed +2 -0
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_base.py +13 -4
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_streaming.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_streaming_async.py +8 -5
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_unary.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/retry/retry_unary_async.py +7 -6
- py2docfx/venv/venv1/Lib/site-packages/google/api_core/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/_default.py +2 -36
- py2docfx/venv/venv1/Lib/site-packages/google/auth/_helpers.py +240 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/aio/_helpers.py +62 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/aio/transport/aiohttp.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/compute_engine/_metadata.py +5 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/compute_engine/credentials.py +2 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/identity_pool.py +91 -2
- py2docfx/venv/venv1/Lib/site-packages/google/auth/impersonated_credentials.py +75 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/py.typed +2 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/__init__.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/_aiohttp_requests.py +8 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/_http_client.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/requests.py +4 -1
- py2docfx/venv/venv1/Lib/site-packages/google/auth/transport/urllib3.py +15 -5
- py2docfx/venv/venv1/Lib/site-packages/google/auth/version.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/cloud/extended_operations_pb2.pyi +45 -0
- py2docfx/venv/venv1/Lib/site-packages/google/cloud/location/locations_pb2.pyi +96 -0
- py2docfx/venv/venv1/Lib/site-packages/google/gapic/metadata/gapic_metadata_pb2.pyi +118 -0
- py2docfx/venv/venv1/Lib/site-packages/google/logging/type/http_request_pb2.pyi +91 -0
- py2docfx/venv/venv1/Lib/site-packages/google/logging/type/log_severity_pb2.pyi +42 -0
- py2docfx/venv/venv1/Lib/site-packages/google/longrunning/operations_proto_pb2.pyi +126 -0
- py2docfx/venv/venv1/Lib/site-packages/google/oauth2/id_token.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/google/oauth2/py.typed +2 -0
- py2docfx/venv/venv1/Lib/site-packages/google/oauth2/webauthn_types.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any.py +15 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/api_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/compiler/plugin_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor.py +15 -2
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pb2.py +258 -113
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pool.py +22 -8
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/duration_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/empty_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/field_mask_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/decoder.py +106 -23
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/field_mask.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_edition_defaults.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_message.py +21 -18
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/testing_refleaks.py +8 -2
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/well_known_types.py +60 -43
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/json_format.py +4 -5
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/message_factory.py +16 -0
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/runtime_version.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/source_context_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/struct_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/text_format.py +11 -7
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/timestamp_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/type_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/protobuf/wrappers_pb2.py +3 -3
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/code_pb2.pyi +58 -0
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/context/attribute_context_pb2.pyi +309 -0
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/context/audit_context_pb2.pyi +51 -0
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/error_details_pb2.py +29 -23
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/error_details_pb2.pyi +246 -0
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/http_pb2.pyi +71 -0
- py2docfx/venv/venv1/Lib/site-packages/google/rpc/status_pb2.pyi +41 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/calendar_period_pb2.pyi +40 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/color_pb2.pyi +42 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/date_pb2.pyi +36 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/datetime_pb2.pyi +77 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/dayofweek_pb2.pyi +40 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/decimal_pb2.pyi +27 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/expr_pb2.pyi +39 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/fraction_pb2.pyi +31 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/interval_pb2.pyi +36 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/latlng_pb2.pyi +31 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/localized_text_pb2.pyi +31 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/money_pb2.pyi +36 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/month_pb2.pyi +50 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/phone_number_pb2.pyi +48 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/postal_address_pb2.pyi +74 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/quaternion_pb2.pyi +39 -0
- py2docfx/venv/venv1/Lib/site-packages/google/type/timeofday_pb2.pyi +39 -0
- py2docfx/venv/venv1/Lib/site-packages/idna/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/jwt/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/msal/application.py +1 -0
- py2docfx/venv/venv1/Lib/site-packages/msal/individual_cache.py +9 -5
- py2docfx/venv/venv1/Lib/site-packages/msal/managed_identity.py +4 -5
- py2docfx/venv/venv1/Lib/site-packages/msal/sku.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/throttled_http_client.py +58 -30
- py2docfx/venv/venv1/Lib/site-packages/opencensus/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/__init__.py +138 -138
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/exporter.py +93 -93
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/processor.py +63 -63
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/protocol.py +206 -206
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/storage.py +205 -205
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/transport.py +355 -355
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/utils.py +79 -79
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/common/version.py +15 -15
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/log_exporter/__init__.py +314 -314
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/__init__.py +190 -190
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/__init__.py +62 -62
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/cpu.py +50 -50
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/http_requests.py +176 -176
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/memory.py +42 -42
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/metrics_exporter/standard_metrics/process.py +87 -87
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/state.py +50 -50
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/statsbeat.py +100 -100
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/statsbeat/statsbeat_metrics.py +480 -480
- py2docfx/venv/venv1/Lib/site-packages/opencensus/ext/azure/trace_exporter/__init__.py +236 -236
- py2docfx/venv/venv1/Lib/site-packages/packaging/__init__.py +15 -0
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/vendored → venv1/Lib/site-packages}/packaging/_elffile.py +10 -9
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/_manylinux.py +13 -11
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/vendored → venv1/Lib/site-packages}/packaging/_musllinux.py +5 -3
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/_parser.py +12 -15
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/_tokenizer.py +15 -12
- py2docfx/venv/venv1/Lib/site-packages/packaging/licenses/__init__.py +145 -0
- py2docfx/venv/venv1/Lib/site-packages/packaging/licenses/_spdx.py +759 -0
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/markers.py +148 -39
- py2docfx/venv/venv1/Lib/site-packages/packaging/metadata.py +862 -0
- py2docfx/venv/venv1/Lib/site-packages/packaging/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/requirements.py +5 -4
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/specifiers.py +41 -33
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/vendored → venv1/Lib/site-packages}/packaging/tags.py +135 -50
- py2docfx/venv/venv1/Lib/site-packages/{wheel/vendored/packaging → packaging}/utils.py +39 -48
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/vendored → venv1/Lib/site-packages}/packaging/version.py +53 -32
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/chardet/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/pyparsing/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/tenacity/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/tomli/py.typed +1 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/pip/py.typed +4 -0
- py2docfx/venv/venv1/Lib/site-packages/pkg_resources/__init__.py +6 -7
- py2docfx/venv/venv1/Lib/site-packages/pkg_resources/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/requests/__version__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/requests/compat.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/requests/models.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/requests/utils.py +6 -16
- py2docfx/venv/venv1/Lib/site-packages/rsa/__init__.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/rsa/asn1.py +52 -52
- py2docfx/venv/venv1/Lib/site-packages/rsa/cli.py +321 -321
- py2docfx/venv/venv1/Lib/site-packages/rsa/common.py +184 -184
- py2docfx/venv/venv1/Lib/site-packages/rsa/core.py +53 -53
- py2docfx/venv/venv1/Lib/site-packages/rsa/key.py +858 -858
- py2docfx/venv/venv1/Lib/site-packages/rsa/parallel.py +96 -96
- py2docfx/venv/venv1/Lib/site-packages/rsa/pem.py +134 -134
- py2docfx/venv/venv1/Lib/site-packages/rsa/pkcs1.py +485 -485
- py2docfx/venv/venv1/Lib/site-packages/rsa/pkcs1_v2.py +100 -100
- py2docfx/venv/venv1/Lib/site-packages/rsa/prime.py +198 -198
- py2docfx/venv/venv1/Lib/site-packages/rsa/py.typed +1 -0
- py2docfx/venv/venv1/Lib/site-packages/rsa/randnum.py +95 -95
- py2docfx/venv/venv1/Lib/site-packages/rsa/transform.py +72 -72
- py2docfx/venv/venv1/Lib/site-packages/rsa/util.py +97 -97
- py2docfx/venv/venv1/Lib/site-packages/setuptools/__init__.py +0 -38
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_discovery.py +33 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/command/config.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/tests/test_unix.py +63 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_distutils/compilers/C/unix.py +5 -6
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_entry_points.py +4 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_normalization.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_path.py +12 -3
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_reqs.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_scripts.py +361 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_shutil.py +6 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/importlib_metadata/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/inflect/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/jaraco/collections/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/jaraco/functools/__init__.pyi +125 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/jaraco/functools/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.pyi +2 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi +709 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/more_itertools/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi +136 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/packaging/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/platformdirs/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/tomli/py.typed +1 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/_vendor/typeguard/py.typed +0 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/build_meta.py +25 -37
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/bdist_egg.py +9 -11
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/bdist_wheel.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/build_ext.py +29 -28
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/develop.py +39 -179
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/easy_install.py +17 -2352
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/editable_wheel.py +14 -31
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/egg_info.py +0 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/install.py +3 -55
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/install_scripts.py +5 -11
- py2docfx/venv/venv1/Lib/site-packages/setuptools/command/sdist.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/setuptools/compat/py310.py +11 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/dist.py +10 -12
- py2docfx/venv/venv1/Lib/site-packages/setuptools/installer.py +34 -29
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/contexts.py +0 -14
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/fixtures.py +235 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/integration/test_pbr.py +20 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_build_meta.py +0 -24
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_develop.py +1 -64
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_dist.py +2 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_dist_info.py +0 -63
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_editable_install.py +15 -41
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_egg_info.py +3 -2
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_scripts.py +12 -0
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_wheel.py +12 -36
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_windows_wrappers.py +3 -4
- py2docfx/venv/venv1/Lib/site-packages/setuptools/wheel.py +49 -24
- py2docfx/venv/venv1/Lib/site-packages/typing_extensions.py +380 -708
- py2docfx/venv/venv1/Lib/site-packages/urllib3/_version.py +9 -4
- py2docfx/venv/venv1/Lib/site-packages/urllib3/connection.py +87 -38
- py2docfx/venv/venv1/Lib/site-packages/urllib3/contrib/emscripten/fetch.py +20 -0
- py2docfx/venv/venv1/Lib/site-packages/urllib3/contrib/emscripten/response.py +8 -16
- py2docfx/venv/venv1/Lib/site-packages/urllib3/contrib/pyopenssl.py +10 -0
- py2docfx/venv/venv1/Lib/site-packages/urllib3/exceptions.py +12 -4
- py2docfx/venv/venv1/Lib/site-packages/urllib3/http2/connection.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/urllib3/poolmanager.py +17 -1
- py2docfx/venv/venv1/Lib/site-packages/urllib3/py.typed +2 -0
- py2docfx/venv/venv1/Lib/site-packages/urllib3/response.py +53 -24
- py2docfx/venv/venv1/Lib/site-packages/urllib3/util/request.py +12 -4
- py2docfx/venv/venv1/Lib/site-packages/urllib3/util/ssl_.py +22 -2
- py2docfx/venv/venv1/Lib/site-packages/urllib3/util/ssl_match_hostname.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/wheel/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/wheel/__main__.py +7 -5
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/cli → venv1/Lib/site-packages/wheel/_commands}/__init__.py +3 -5
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/cli → venv1/Lib/site-packages/wheel/_commands}/convert.py +14 -9
- py2docfx/venv/{basevenv/Lib/site-packages/wheel/cli → venv1/Lib/site-packages/wheel/_commands}/pack.py +1 -2
- py2docfx/venv/venv1/Lib/site-packages/wheel/{cli → _commands}/tags.py +4 -3
- py2docfx/venv/venv1/Lib/site-packages/wheel/_metadata.py +184 -0
- py2docfx/venv/venv1/Lib/site-packages/wheel/bdist_wheel.py +12 -23
- py2docfx/venv/venv1/Lib/site-packages/wheel/macosx_libfile.py +4 -0
- py2docfx/venv/venv1/Lib/site-packages/wheel/metadata.py +17 -183
- py2docfx/venv/venv1/Lib/site-packages/wheel/wheelfile.py +30 -16
- {py2docfx-0.1.16rc2051518.dist-info → py2docfx-0.1.17.dist-info}/METADATA +2 -3
- {py2docfx-0.1.16rc2051518.dist-info → py2docfx-0.1.17.dist-info}/RECORD +588 -427
- {py2docfx-0.1.16rc2051518.dist-info → py2docfx-0.1.17.dist-info}/WHEEL +1 -1
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/package_index.py +0 -1137
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/sandbox.py +0 -536
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/server.py +0 -86
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_easy_install.py +0 -1476
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_packageindex.py +0 -267
- py2docfx/venv/basevenv/Lib/site-packages/setuptools/tests/test_sandbox.py +0 -134
- py2docfx/venv/basevenv/Lib/site-packages/wheel/_bdist_wheel.py +0 -613
- py2docfx/venv/basevenv/Lib/site-packages/wheel/_setuptools_logging.py +0 -26
- py2docfx/venv/basevenv/Lib/site-packages/wheel/util.py +0 -17
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/_manylinux.py +0 -260
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/_parser.py +0 -356
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/_tokenizer.py +0 -192
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/markers.py +0 -253
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/requirements.py +0 -90
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/specifiers.py +0 -1011
- py2docfx/venv/basevenv/Lib/site-packages/wheel/vendored/packaging/utils.py +0 -172
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/application.py +0 -119
- py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/application.py +0 -121
- py2docfx/venv/venv1/Lib/site-packages/setuptools/package_index.py +0 -1137
- py2docfx/venv/venv1/Lib/site-packages/setuptools/sandbox.py +0 -536
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/server.py +0 -86
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_easy_install.py +0 -1476
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_packageindex.py +0 -267
- py2docfx/venv/venv1/Lib/site-packages/setuptools/tests/test_sandbox.py +0 -134
- py2docfx/venv/venv1/Lib/site-packages/wheel/_bdist_wheel.py +0 -613
- py2docfx/venv/venv1/Lib/site-packages/wheel/_setuptools_logging.py +0 -26
- py2docfx/venv/venv1/Lib/site-packages/wheel/util.py +0 -17
- py2docfx/venv/venv1/Lib/site-packages/wheel/vendored/packaging/_elffile.py +0 -108
- py2docfx/venv/venv1/Lib/site-packages/wheel/vendored/packaging/_musllinux.py +0 -83
- py2docfx/venv/venv1/Lib/site-packages/wheel/vendored/packaging/_structures.py +0 -61
- py2docfx/venv/venv1/Lib/site-packages/wheel/vendored/packaging/tags.py +0 -571
- py2docfx/venv/venv1/Lib/site-packages/wheel/vendored/packaging/version.py +0 -561
- /py2docfx/venv/basevenv/Lib/site-packages/{wheel/vendored/__init__.py → certifi/py.typed} +0 -0
- /py2docfx/venv/basevenv/Lib/site-packages/{wheel/vendored/packaging/__init__.py → charset_normalizer/py.typed} +0 -0
- /py2docfx/venv/{venv1/Lib/site-packages/wheel/vendored/__init__.py → basevenv/Lib/site-packages/idna/py.typed} +0 -0
- /py2docfx/venv/{venv1/Lib/site-packages/wheel/vendored/packaging/__init__.py → basevenv/Lib/site-packages/jinja2/py.typed} +0 -0
- /py2docfx/venv/basevenv/Lib/site-packages/wheel/{cli → _commands}/unpack.py +0 -0
- /py2docfx/venv/{basevenv/Lib/site-packages/wheel/vendored → venv1/Lib/site-packages}/packaging/_structures.py +0 -0
- /py2docfx/venv/venv1/Lib/site-packages/wheel/{cli → _commands}/unpack.py +0 -0
- {py2docfx-0.1.16rc2051518.dist-info → py2docfx-0.1.17.dist-info}/top_level.txt +0 -0
@@ -6,6 +6,7 @@ import contextlib
|
|
6
6
|
import enum
|
7
7
|
import functools
|
8
8
|
import inspect
|
9
|
+
import io
|
9
10
|
import keyword
|
10
11
|
import operator
|
11
12
|
import sys
|
@@ -13,6 +14,9 @@ import types as _types
|
|
13
14
|
import typing
|
14
15
|
import warnings
|
15
16
|
|
17
|
+
if sys.version_info >= (3, 14):
|
18
|
+
import annotationlib
|
19
|
+
|
16
20
|
__all__ = [
|
17
21
|
# Super-special typing primitives.
|
18
22
|
'Any',
|
@@ -56,6 +60,8 @@ __all__ = [
|
|
56
60
|
'SupportsIndex',
|
57
61
|
'SupportsInt',
|
58
62
|
'SupportsRound',
|
63
|
+
'Reader',
|
64
|
+
'Writer',
|
59
65
|
|
60
66
|
# One-off things.
|
61
67
|
'Annotated',
|
@@ -83,6 +89,7 @@ __all__ = [
|
|
83
89
|
'overload',
|
84
90
|
'override',
|
85
91
|
'Protocol',
|
92
|
+
'Sentinel',
|
86
93
|
'reveal_type',
|
87
94
|
'runtime',
|
88
95
|
'runtime_checkable',
|
@@ -166,12 +173,9 @@ if sys.version_info >= (3, 10):
|
|
166
173
|
return isinstance(
|
167
174
|
t, (typing._GenericAlias, _types.GenericAlias, _types.UnionType)
|
168
175
|
)
|
169
|
-
elif sys.version_info >= (3, 9):
|
170
|
-
def _should_collect_from_parameters(t):
|
171
|
-
return isinstance(t, (typing._GenericAlias, _types.GenericAlias))
|
172
176
|
else:
|
173
177
|
def _should_collect_from_parameters(t):
|
174
|
-
return isinstance(t, typing._GenericAlias
|
178
|
+
return isinstance(t, (typing._GenericAlias, _types.GenericAlias))
|
175
179
|
|
176
180
|
|
177
181
|
NoReturn = typing.NoReturn
|
@@ -434,28 +438,14 @@ else:
|
|
434
438
|
def _is_dunder(attr):
|
435
439
|
return attr.startswith('__') and attr.endswith('__')
|
436
440
|
|
437
|
-
# Python <3.9 doesn't have typing._SpecialGenericAlias
|
438
|
-
_special_generic_alias_base = getattr(
|
439
|
-
typing, "_SpecialGenericAlias", typing._GenericAlias
|
440
|
-
)
|
441
441
|
|
442
|
-
class _SpecialGenericAlias(
|
442
|
+
class _SpecialGenericAlias(typing._SpecialGenericAlias, _root=True):
|
443
443
|
def __init__(self, origin, nparams, *, inst=True, name=None, defaults=()):
|
444
|
-
|
445
|
-
# Python <3.9
|
446
|
-
self.__origin__ = origin
|
447
|
-
self._nparams = nparams
|
448
|
-
super().__init__(origin, nparams, special=True, inst=inst, name=name)
|
449
|
-
else:
|
450
|
-
# Python >= 3.9
|
451
|
-
super().__init__(origin, nparams, inst=inst, name=name)
|
444
|
+
super().__init__(origin, nparams, inst=inst, name=name)
|
452
445
|
self._defaults = defaults
|
453
446
|
|
454
447
|
def __setattr__(self, attr, val):
|
455
448
|
allowed_attrs = {'_name', '_inst', '_nparams', '_defaults'}
|
456
|
-
if _special_generic_alias_base is typing._GenericAlias:
|
457
|
-
# Python <3.9
|
458
|
-
allowed_attrs.add("__origin__")
|
459
449
|
if _is_dunder(attr) or attr in allowed_attrs:
|
460
450
|
object.__setattr__(self, attr, val)
|
461
451
|
else:
|
@@ -538,11 +528,16 @@ def _get_protocol_attrs(cls):
|
|
538
528
|
return attrs
|
539
529
|
|
540
530
|
|
541
|
-
def _caller(depth=
|
531
|
+
def _caller(depth=1, default='__main__'):
|
542
532
|
try:
|
543
|
-
return sys.
|
533
|
+
return sys._getframemodulename(depth + 1) or default
|
534
|
+
except AttributeError: # For platforms without _getframemodulename()
|
535
|
+
pass
|
536
|
+
try:
|
537
|
+
return sys._getframe(depth + 1).f_globals.get('__name__', default)
|
544
538
|
except (AttributeError, ValueError): # For platforms without _getframe()
|
545
|
-
|
539
|
+
pass
|
540
|
+
return None
|
546
541
|
|
547
542
|
|
548
543
|
# `__match_args__` attribute was removed from protocol members in 3.13,
|
@@ -550,7 +545,7 @@ def _caller(depth=2):
|
|
550
545
|
if sys.version_info >= (3, 13):
|
551
546
|
Protocol = typing.Protocol
|
552
547
|
else:
|
553
|
-
def _allow_reckless_class_checks(depth=
|
548
|
+
def _allow_reckless_class_checks(depth=2):
|
554
549
|
"""Allow instance and class checks for special stdlib modules.
|
555
550
|
The abc and functools modules indiscriminately call isinstance() and
|
556
551
|
issubclass() on the whole MRO of a user class, which may contain protocols.
|
@@ -585,7 +580,7 @@ else:
|
|
585
580
|
# but is necessary for several reasons...
|
586
581
|
#
|
587
582
|
# NOTE: DO NOT call super() in any methods in this class
|
588
|
-
# That would call the methods on typing._ProtocolMeta on Python 3.
|
583
|
+
# That would call the methods on typing._ProtocolMeta on Python <=3.11
|
589
584
|
# and those are slow
|
590
585
|
def __new__(mcls, name, bases, namespace, **kwargs):
|
591
586
|
if name == "Protocol" and len(bases) < 2:
|
@@ -786,7 +781,7 @@ else:
|
|
786
781
|
runtime = runtime_checkable
|
787
782
|
|
788
783
|
|
789
|
-
# Our version of runtime-checkable protocols is faster on Python 3.
|
784
|
+
# Our version of runtime-checkable protocols is faster on Python <=3.11
|
790
785
|
if sys.version_info >= (3, 12):
|
791
786
|
SupportsInt = typing.SupportsInt
|
792
787
|
SupportsFloat = typing.SupportsFloat
|
@@ -863,19 +858,39 @@ else:
|
|
863
858
|
pass
|
864
859
|
|
865
860
|
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
861
|
+
if hasattr(io, "Reader") and hasattr(io, "Writer"):
|
862
|
+
Reader = io.Reader
|
863
|
+
Writer = io.Writer
|
864
|
+
else:
|
865
|
+
@runtime_checkable
|
866
|
+
class Reader(Protocol[T_co]):
|
867
|
+
"""Protocol for simple I/O reader instances.
|
868
|
+
|
869
|
+
This protocol only supports blocking I/O.
|
870
|
+
"""
|
871
|
+
|
872
|
+
__slots__ = ()
|
873
|
+
|
874
|
+
@abc.abstractmethod
|
875
|
+
def read(self, size: int = ..., /) -> T_co:
|
876
|
+
"""Read data from the input stream and return it.
|
877
|
+
|
878
|
+
If *size* is specified, at most *size* items (bytes/characters) will be
|
879
|
+
read.
|
880
|
+
"""
|
881
|
+
|
882
|
+
@runtime_checkable
|
883
|
+
class Writer(Protocol[T_contra]):
|
884
|
+
"""Protocol for simple I/O writer instances.
|
885
|
+
|
886
|
+
This protocol only supports blocking I/O.
|
887
|
+
"""
|
888
|
+
|
889
|
+
__slots__ = ()
|
890
|
+
|
891
|
+
@abc.abstractmethod
|
892
|
+
def write(self, data: T_contra, /) -> int:
|
893
|
+
"""Write *data* to the output stream and return the number of items written.""" # noqa: E501
|
879
894
|
|
880
895
|
|
881
896
|
_NEEDS_SINGLETONMETA = (
|
@@ -940,8 +955,6 @@ if _NEEDS_SINGLETONMETA:
|
|
940
955
|
_PEP_728_IMPLEMENTED = False
|
941
956
|
|
942
957
|
if _PEP_728_IMPLEMENTED:
|
943
|
-
# The standard library TypedDict in Python 3.8 does not store runtime information
|
944
|
-
# about which (if any) keys are optional. See https://bugs.python.org/issue38834
|
945
958
|
# The standard library TypedDict in Python 3.9.0/1 does not honour the "total"
|
946
959
|
# keyword with old-style TypedDict(). See https://bugs.python.org/issue42059
|
947
960
|
# The standard library TypedDict below Python 3.11 does not store runtime
|
@@ -1003,6 +1016,8 @@ else:
|
|
1003
1016
|
else:
|
1004
1017
|
generic_base = ()
|
1005
1018
|
|
1019
|
+
ns_annotations = ns.pop('__annotations__', None)
|
1020
|
+
|
1006
1021
|
# typing.py generally doesn't let you inherit from plain Generic, unless
|
1007
1022
|
# the name of the class happens to be "Protocol"
|
1008
1023
|
tp_dict = type.__new__(_TypedDictMeta, "Protocol", (*generic_base, dict), ns)
|
@@ -1014,21 +1029,31 @@ else:
|
|
1014
1029
|
tp_dict.__orig_bases__ = bases
|
1015
1030
|
|
1016
1031
|
annotations = {}
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1032
|
+
own_annotate = None
|
1033
|
+
if ns_annotations is not None:
|
1034
|
+
own_annotations = ns_annotations
|
1035
|
+
elif sys.version_info >= (3, 14):
|
1036
|
+
if hasattr(annotationlib, "get_annotate_from_class_namespace"):
|
1037
|
+
own_annotate = annotationlib.get_annotate_from_class_namespace(ns)
|
1038
|
+
else:
|
1039
|
+
# 3.14.0a7 and earlier
|
1040
|
+
own_annotate = ns.get("__annotate__")
|
1041
|
+
if own_annotate is not None:
|
1042
|
+
own_annotations = annotationlib.call_annotate_function(
|
1043
|
+
own_annotate, Format.FORWARDREF, owner=tp_dict
|
1044
|
+
)
|
1045
|
+
else:
|
1046
|
+
own_annotations = {}
|
1022
1047
|
else:
|
1023
1048
|
own_annotations = {}
|
1024
1049
|
msg = "TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a type"
|
1025
1050
|
if _TAKES_MODULE:
|
1026
|
-
|
1051
|
+
own_checked_annotations = {
|
1027
1052
|
n: typing._type_check(tp, msg, module=tp_dict.__module__)
|
1028
1053
|
for n, tp in own_annotations.items()
|
1029
1054
|
}
|
1030
1055
|
else:
|
1031
|
-
|
1056
|
+
own_checked_annotations = {
|
1032
1057
|
n: typing._type_check(tp, msg)
|
1033
1058
|
for n, tp in own_annotations.items()
|
1034
1059
|
}
|
@@ -1041,7 +1066,8 @@ else:
|
|
1041
1066
|
for base in bases:
|
1042
1067
|
base_dict = base.__dict__
|
1043
1068
|
|
1044
|
-
|
1069
|
+
if sys.version_info <= (3, 14):
|
1070
|
+
annotations.update(base_dict.get('__annotations__', {}))
|
1045
1071
|
required_keys.update(base_dict.get('__required_keys__', ()))
|
1046
1072
|
optional_keys.update(base_dict.get('__optional_keys__', ()))
|
1047
1073
|
readonly_keys.update(base_dict.get('__readonly_keys__', ()))
|
@@ -1051,8 +1077,8 @@ else:
|
|
1051
1077
|
# is retained for backwards compatibility, but only for Python
|
1052
1078
|
# 3.13 and lower.
|
1053
1079
|
if (closed and sys.version_info < (3, 14)
|
1054
|
-
and "__extra_items__" in
|
1055
|
-
annotation_type =
|
1080
|
+
and "__extra_items__" in own_checked_annotations):
|
1081
|
+
annotation_type = own_checked_annotations.pop("__extra_items__")
|
1056
1082
|
qualifiers = set(_get_typeddict_qualifiers(annotation_type))
|
1057
1083
|
if Required in qualifiers:
|
1058
1084
|
raise TypeError(
|
@@ -1066,8 +1092,8 @@ else:
|
|
1066
1092
|
)
|
1067
1093
|
extra_items_type = annotation_type
|
1068
1094
|
|
1069
|
-
annotations.update(
|
1070
|
-
for annotation_key, annotation_type in
|
1095
|
+
annotations.update(own_checked_annotations)
|
1096
|
+
for annotation_key, annotation_type in own_checked_annotations.items():
|
1071
1097
|
qualifiers = set(_get_typeddict_qualifiers(annotation_type))
|
1072
1098
|
|
1073
1099
|
if Required in qualifiers:
|
@@ -1085,7 +1111,38 @@ else:
|
|
1085
1111
|
mutable_keys.add(annotation_key)
|
1086
1112
|
readonly_keys.discard(annotation_key)
|
1087
1113
|
|
1088
|
-
|
1114
|
+
if sys.version_info >= (3, 14):
|
1115
|
+
def __annotate__(format):
|
1116
|
+
annos = {}
|
1117
|
+
for base in bases:
|
1118
|
+
if base is Generic:
|
1119
|
+
continue
|
1120
|
+
base_annotate = base.__annotate__
|
1121
|
+
if base_annotate is None:
|
1122
|
+
continue
|
1123
|
+
base_annos = annotationlib.call_annotate_function(
|
1124
|
+
base_annotate, format, owner=base)
|
1125
|
+
annos.update(base_annos)
|
1126
|
+
if own_annotate is not None:
|
1127
|
+
own = annotationlib.call_annotate_function(
|
1128
|
+
own_annotate, format, owner=tp_dict)
|
1129
|
+
if format != Format.STRING:
|
1130
|
+
own = {
|
1131
|
+
n: typing._type_check(tp, msg, module=tp_dict.__module__)
|
1132
|
+
for n, tp in own.items()
|
1133
|
+
}
|
1134
|
+
elif format == Format.STRING:
|
1135
|
+
own = annotationlib.annotations_to_string(own_annotations)
|
1136
|
+
elif format in (Format.FORWARDREF, Format.VALUE):
|
1137
|
+
own = own_checked_annotations
|
1138
|
+
else:
|
1139
|
+
raise NotImplementedError(format)
|
1140
|
+
annos.update(own)
|
1141
|
+
return annos
|
1142
|
+
|
1143
|
+
tp_dict.__annotate__ = __annotate__
|
1144
|
+
else:
|
1145
|
+
tp_dict.__annotations__ = annotations
|
1089
1146
|
tp_dict.__required_keys__ = frozenset(required_keys)
|
1090
1147
|
tp_dict.__optional_keys__ = frozenset(optional_keys)
|
1091
1148
|
tp_dict.__readonly_keys__ = frozenset(readonly_keys)
|
@@ -1105,17 +1162,94 @@ else:
|
|
1105
1162
|
|
1106
1163
|
_TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {})
|
1107
1164
|
|
1108
|
-
|
1109
|
-
def TypedDict(
|
1165
|
+
def _create_typeddict(
|
1110
1166
|
typename,
|
1111
|
-
fields
|
1167
|
+
fields,
|
1112
1168
|
/,
|
1113
1169
|
*,
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1170
|
+
typing_is_inline,
|
1171
|
+
total,
|
1172
|
+
closed,
|
1173
|
+
extra_items,
|
1174
|
+
**kwargs,
|
1118
1175
|
):
|
1176
|
+
if fields is _marker or fields is None:
|
1177
|
+
if fields is _marker:
|
1178
|
+
deprecated_thing = (
|
1179
|
+
"Failing to pass a value for the 'fields' parameter"
|
1180
|
+
)
|
1181
|
+
else:
|
1182
|
+
deprecated_thing = "Passing `None` as the 'fields' parameter"
|
1183
|
+
|
1184
|
+
example = f"`{typename} = TypedDict({typename!r}, {{}})`"
|
1185
|
+
deprecation_msg = (
|
1186
|
+
f"{deprecated_thing} is deprecated and will be disallowed in "
|
1187
|
+
"Python 3.15. To create a TypedDict class with 0 fields "
|
1188
|
+
"using the functional syntax, pass an empty dictionary, e.g. "
|
1189
|
+
) + example + "."
|
1190
|
+
warnings.warn(deprecation_msg, DeprecationWarning, stacklevel=2)
|
1191
|
+
# Support a field called "closed"
|
1192
|
+
if closed is not False and closed is not True and closed is not None:
|
1193
|
+
kwargs["closed"] = closed
|
1194
|
+
closed = None
|
1195
|
+
# Or "extra_items"
|
1196
|
+
if extra_items is not NoExtraItems:
|
1197
|
+
kwargs["extra_items"] = extra_items
|
1198
|
+
extra_items = NoExtraItems
|
1199
|
+
fields = kwargs
|
1200
|
+
elif kwargs:
|
1201
|
+
raise TypeError("TypedDict takes either a dict or keyword arguments,"
|
1202
|
+
" but not both")
|
1203
|
+
if kwargs:
|
1204
|
+
if sys.version_info >= (3, 13):
|
1205
|
+
raise TypeError("TypedDict takes no keyword arguments")
|
1206
|
+
warnings.warn(
|
1207
|
+
"The kwargs-based syntax for TypedDict definitions is deprecated "
|
1208
|
+
"in Python 3.11, will be removed in Python 3.13, and may not be "
|
1209
|
+
"understood by third-party type checkers.",
|
1210
|
+
DeprecationWarning,
|
1211
|
+
stacklevel=2,
|
1212
|
+
)
|
1213
|
+
|
1214
|
+
ns = {'__annotations__': dict(fields)}
|
1215
|
+
module = _caller(depth=4 if typing_is_inline else 2)
|
1216
|
+
if module is not None:
|
1217
|
+
# Setting correct module is necessary to make typed dict classes
|
1218
|
+
# pickleable.
|
1219
|
+
ns['__module__'] = module
|
1220
|
+
|
1221
|
+
td = _TypedDictMeta(typename, (), ns, total=total, closed=closed,
|
1222
|
+
extra_items=extra_items)
|
1223
|
+
td.__orig_bases__ = (TypedDict,)
|
1224
|
+
return td
|
1225
|
+
|
1226
|
+
class _TypedDictSpecialForm(_ExtensionsSpecialForm, _root=True):
|
1227
|
+
def __call__(
|
1228
|
+
self,
|
1229
|
+
typename,
|
1230
|
+
fields=_marker,
|
1231
|
+
/,
|
1232
|
+
*,
|
1233
|
+
total=True,
|
1234
|
+
closed=None,
|
1235
|
+
extra_items=NoExtraItems,
|
1236
|
+
**kwargs
|
1237
|
+
):
|
1238
|
+
return _create_typeddict(
|
1239
|
+
typename,
|
1240
|
+
fields,
|
1241
|
+
typing_is_inline=False,
|
1242
|
+
total=total,
|
1243
|
+
closed=closed,
|
1244
|
+
extra_items=extra_items,
|
1245
|
+
**kwargs,
|
1246
|
+
)
|
1247
|
+
|
1248
|
+
def __mro_entries__(self, bases):
|
1249
|
+
return (_TypedDict,)
|
1250
|
+
|
1251
|
+
@_TypedDictSpecialForm
|
1252
|
+
def TypedDict(self, args):
|
1119
1253
|
"""A simple typed namespace. At runtime it is equivalent to a plain dict.
|
1120
1254
|
|
1121
1255
|
TypedDict creates a dictionary type such that a type checker will expect all
|
@@ -1162,57 +1296,22 @@ else:
|
|
1162
1296
|
|
1163
1297
|
See PEP 655 for more details on Required and NotRequired.
|
1164
1298
|
"""
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
deprecated_thing = "Passing `None` as the 'fields' parameter"
|
1170
|
-
|
1171
|
-
example = f"`{typename} = TypedDict({typename!r}, {{}})`"
|
1172
|
-
deprecation_msg = (
|
1173
|
-
f"{deprecated_thing} is deprecated and will be disallowed in "
|
1174
|
-
"Python 3.15. To create a TypedDict class with 0 fields "
|
1175
|
-
"using the functional syntax, pass an empty dictionary, e.g. "
|
1176
|
-
) + example + "."
|
1177
|
-
warnings.warn(deprecation_msg, DeprecationWarning, stacklevel=2)
|
1178
|
-
# Support a field called "closed"
|
1179
|
-
if closed is not False and closed is not True and closed is not None:
|
1180
|
-
kwargs["closed"] = closed
|
1181
|
-
closed = None
|
1182
|
-
# Or "extra_items"
|
1183
|
-
if extra_items is not NoExtraItems:
|
1184
|
-
kwargs["extra_items"] = extra_items
|
1185
|
-
extra_items = NoExtraItems
|
1186
|
-
fields = kwargs
|
1187
|
-
elif kwargs:
|
1188
|
-
raise TypeError("TypedDict takes either a dict or keyword arguments,"
|
1189
|
-
" but not both")
|
1190
|
-
if kwargs:
|
1191
|
-
if sys.version_info >= (3, 13):
|
1192
|
-
raise TypeError("TypedDict takes no keyword arguments")
|
1193
|
-
warnings.warn(
|
1194
|
-
"The kwargs-based syntax for TypedDict definitions is deprecated "
|
1195
|
-
"in Python 3.11, will be removed in Python 3.13, and may not be "
|
1196
|
-
"understood by third-party type checkers.",
|
1197
|
-
DeprecationWarning,
|
1198
|
-
stacklevel=2,
|
1299
|
+
# This runs when creating inline TypedDicts:
|
1300
|
+
if not isinstance(args, dict):
|
1301
|
+
raise TypeError(
|
1302
|
+
"TypedDict[...] should be used with a single dict argument"
|
1199
1303
|
)
|
1200
1304
|
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1305
|
+
return _create_typeddict(
|
1306
|
+
"<inline TypedDict>",
|
1307
|
+
args,
|
1308
|
+
typing_is_inline=True,
|
1309
|
+
total=True,
|
1310
|
+
closed=True,
|
1311
|
+
extra_items=NoExtraItems,
|
1312
|
+
)
|
1206
1313
|
|
1207
|
-
|
1208
|
-
extra_items=extra_items)
|
1209
|
-
td.__orig_bases__ = (TypedDict,)
|
1210
|
-
return td
|
1211
|
-
|
1212
|
-
if hasattr(typing, "_TypedDictMeta"):
|
1213
|
-
_TYPEDDICT_TYPES = (typing._TypedDictMeta, _TypedDictMeta)
|
1214
|
-
else:
|
1215
|
-
_TYPEDDICT_TYPES = (_TypedDictMeta,)
|
1314
|
+
_TYPEDDICT_TYPES = (typing._TypedDictMeta, _TypedDictMeta)
|
1216
1315
|
|
1217
1316
|
def is_typeddict(tp):
|
1218
1317
|
"""Check if an annotation is a TypedDict class
|
@@ -1225,9 +1324,6 @@ else:
|
|
1225
1324
|
is_typeddict(Film) # => True
|
1226
1325
|
is_typeddict(Union[list, str]) # => False
|
1227
1326
|
"""
|
1228
|
-
# On 3.8, this would otherwise return True
|
1229
|
-
if hasattr(typing, "TypedDict") and tp is typing.TypedDict:
|
1230
|
-
return False
|
1231
1327
|
return isinstance(tp, _TYPEDDICT_TYPES)
|
1232
1328
|
|
1233
1329
|
|
@@ -1257,7 +1353,7 @@ else: # <=3.13
|
|
1257
1353
|
# replaces _strip_annotations()
|
1258
1354
|
def _strip_extras(t):
|
1259
1355
|
"""Strips Annotated, Required and NotRequired from a given type."""
|
1260
|
-
if isinstance(t, _AnnotatedAlias):
|
1356
|
+
if isinstance(t, typing._AnnotatedAlias):
|
1261
1357
|
return _strip_extras(t.__origin__)
|
1262
1358
|
if hasattr(t, "__origin__") and t.__origin__ in (Required, NotRequired, ReadOnly):
|
1263
1359
|
return _strip_extras(t.__args__[0])
|
@@ -1311,23 +1407,11 @@ else: # <=3.13
|
|
1311
1407
|
- If two dict arguments are passed, they specify globals and
|
1312
1408
|
locals, respectively.
|
1313
1409
|
"""
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
)
|
1318
|
-
else: # 3.8
|
1319
|
-
hint = typing.get_type_hints(obj, globalns=globalns, localns=localns)
|
1410
|
+
hint = typing.get_type_hints(
|
1411
|
+
obj, globalns=globalns, localns=localns, include_extras=True
|
1412
|
+
)
|
1320
1413
|
if sys.version_info < (3, 11):
|
1321
1414
|
_clean_optional(obj, hint, globalns, localns)
|
1322
|
-
if sys.version_info < (3, 9):
|
1323
|
-
# In 3.8 eval_type does not flatten Optional[ForwardRef] correctly
|
1324
|
-
# This will recreate and and cache Unions.
|
1325
|
-
hint = {
|
1326
|
-
k: (t
|
1327
|
-
if get_origin(t) != Union
|
1328
|
-
else Union[t.__args__])
|
1329
|
-
for k, t in hint.items()
|
1330
|
-
}
|
1331
1415
|
if include_extras:
|
1332
1416
|
return hint
|
1333
1417
|
return {k: _strip_extras(t) for k, t in hint.items()}
|
@@ -1336,8 +1420,7 @@ else: # <=3.13
|
|
1336
1420
|
|
1337
1421
|
def _could_be_inserted_optional(t):
|
1338
1422
|
"""detects Union[..., None] pattern"""
|
1339
|
-
|
1340
|
-
if get_origin(t) is not Union:
|
1423
|
+
if not isinstance(t, typing._UnionGenericAlias):
|
1341
1424
|
return False
|
1342
1425
|
# Assume if last argument is not None they are user defined
|
1343
1426
|
if t.__args__[-1] is not _NoneType:
|
@@ -1381,17 +1464,12 @@ else: # <=3.13
|
|
1381
1464
|
localns = globalns
|
1382
1465
|
elif localns is None:
|
1383
1466
|
localns = globalns
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
is_argument=not isinstance(obj, _types.ModuleType)
|
1390
|
-
)
|
1467
|
+
|
1468
|
+
original_value = ForwardRef(
|
1469
|
+
original_value,
|
1470
|
+
is_argument=not isinstance(obj, _types.ModuleType)
|
1471
|
+
)
|
1391
1472
|
original_evaluated = typing._eval_type(original_value, globalns, localns)
|
1392
|
-
if sys.version_info < (3, 9) and get_origin(original_evaluated) is Union:
|
1393
|
-
# Union[str, None, "str"] is not reduced to Union[str, None]
|
1394
|
-
original_evaluated = Union[original_evaluated.__args__]
|
1395
1473
|
# Compare if values differ. Note that even if equal
|
1396
1474
|
# value might be cached by typing._tp_cache contrary to original_evaluated
|
1397
1475
|
if original_evaluated != value or (
|
@@ -1402,130 +1480,13 @@ else: # <=3.13
|
|
1402
1480
|
):
|
1403
1481
|
hints[name] = original_evaluated
|
1404
1482
|
|
1405
|
-
# Python 3.9
|
1406
|
-
if hasattr(typing, 'Annotated'):
|
1407
|
-
Annotated = typing.Annotated
|
1408
|
-
# Not exported and not a public API, but needed for get_origin() and get_args()
|
1409
|
-
# to work.
|
1410
|
-
_AnnotatedAlias = typing._AnnotatedAlias
|
1411
|
-
# 3.8
|
1412
|
-
else:
|
1413
|
-
class _AnnotatedAlias(typing._GenericAlias, _root=True):
|
1414
|
-
"""Runtime representation of an annotated type.
|
1415
|
-
|
1416
|
-
At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't'
|
1417
|
-
with extra annotations. The alias behaves like a normal typing alias,
|
1418
|
-
instantiating is the same as instantiating the underlying type, binding
|
1419
|
-
it to types is also the same.
|
1420
|
-
"""
|
1421
|
-
def __init__(self, origin, metadata):
|
1422
|
-
if isinstance(origin, _AnnotatedAlias):
|
1423
|
-
metadata = origin.__metadata__ + metadata
|
1424
|
-
origin = origin.__origin__
|
1425
|
-
super().__init__(origin, origin)
|
1426
|
-
self.__metadata__ = metadata
|
1427
|
-
|
1428
|
-
def copy_with(self, params):
|
1429
|
-
assert len(params) == 1
|
1430
|
-
new_type = params[0]
|
1431
|
-
return _AnnotatedAlias(new_type, self.__metadata__)
|
1432
|
-
|
1433
|
-
def __repr__(self):
|
1434
|
-
return (f"typing_extensions.Annotated[{typing._type_repr(self.__origin__)}, "
|
1435
|
-
f"{', '.join(repr(a) for a in self.__metadata__)}]")
|
1436
|
-
|
1437
|
-
def __reduce__(self):
|
1438
|
-
return operator.getitem, (
|
1439
|
-
Annotated, (self.__origin__, *self.__metadata__)
|
1440
|
-
)
|
1441
|
-
|
1442
|
-
def __eq__(self, other):
|
1443
|
-
if not isinstance(other, _AnnotatedAlias):
|
1444
|
-
return NotImplemented
|
1445
|
-
if self.__origin__ != other.__origin__:
|
1446
|
-
return False
|
1447
|
-
return self.__metadata__ == other.__metadata__
|
1448
|
-
|
1449
|
-
def __hash__(self):
|
1450
|
-
return hash((self.__origin__, self.__metadata__))
|
1451
|
-
|
1452
|
-
class Annotated:
|
1453
|
-
"""Add context specific metadata to a type.
|
1454
|
-
|
1455
|
-
Example: Annotated[int, runtime_check.Unsigned] indicates to the
|
1456
|
-
hypothetical runtime_check module that this type is an unsigned int.
|
1457
|
-
Every other consumer of this type can ignore this metadata and treat
|
1458
|
-
this type as int.
|
1459
|
-
|
1460
|
-
The first argument to Annotated must be a valid type (and will be in
|
1461
|
-
the __origin__ field), the remaining arguments are kept as a tuple in
|
1462
|
-
the __extra__ field.
|
1463
|
-
|
1464
|
-
Details:
|
1465
|
-
|
1466
|
-
- It's an error to call `Annotated` with less than two arguments.
|
1467
|
-
- Nested Annotated are flattened::
|
1468
|
-
|
1469
|
-
Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]
|
1470
|
-
|
1471
|
-
- Instantiating an annotated type is equivalent to instantiating the
|
1472
|
-
underlying type::
|
1473
|
-
|
1474
|
-
Annotated[C, Ann1](5) == C(5)
|
1475
|
-
|
1476
|
-
- Annotated can be used as a generic type alias::
|
1477
|
-
|
1478
|
-
Optimized = Annotated[T, runtime.Optimize()]
|
1479
|
-
Optimized[int] == Annotated[int, runtime.Optimize()]
|
1480
|
-
|
1481
|
-
OptimizedList = Annotated[List[T], runtime.Optimize()]
|
1482
|
-
OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
|
1483
|
-
"""
|
1484
|
-
|
1485
|
-
__slots__ = ()
|
1486
|
-
|
1487
|
-
def __new__(cls, *args, **kwargs):
|
1488
|
-
raise TypeError("Type Annotated cannot be instantiated.")
|
1489
|
-
|
1490
|
-
@typing._tp_cache
|
1491
|
-
def __class_getitem__(cls, params):
|
1492
|
-
if not isinstance(params, tuple) or len(params) < 2:
|
1493
|
-
raise TypeError("Annotated[...] should be used "
|
1494
|
-
"with at least two arguments (a type and an "
|
1495
|
-
"annotation).")
|
1496
|
-
allowed_special_forms = (ClassVar, Final)
|
1497
|
-
if get_origin(params[0]) in allowed_special_forms:
|
1498
|
-
origin = params[0]
|
1499
|
-
else:
|
1500
|
-
msg = "Annotated[t, ...]: t must be a type."
|
1501
|
-
origin = typing._type_check(params[0], msg)
|
1502
|
-
metadata = tuple(params[1:])
|
1503
|
-
return _AnnotatedAlias(origin, metadata)
|
1504
|
-
|
1505
|
-
def __init_subclass__(cls, *args, **kwargs):
|
1506
|
-
raise TypeError(
|
1507
|
-
f"Cannot subclass {cls.__module__}.Annotated"
|
1508
|
-
)
|
1509
|
-
|
1510
|
-
# Python 3.8 has get_origin() and get_args() but those implementations aren't
|
1511
|
-
# Annotated-aware, so we can't use those. Python 3.9's versions don't support
|
1483
|
+
# Python 3.9 has get_origin() and get_args() but those implementations don't support
|
1512
1484
|
# ParamSpecArgs and ParamSpecKwargs, so only Python 3.10's versions will do.
|
1513
1485
|
if sys.version_info[:2] >= (3, 10):
|
1514
1486
|
get_origin = typing.get_origin
|
1515
1487
|
get_args = typing.get_args
|
1516
|
-
# 3.
|
1488
|
+
# 3.9
|
1517
1489
|
else:
|
1518
|
-
try:
|
1519
|
-
# 3.9+
|
1520
|
-
from typing import _BaseGenericAlias
|
1521
|
-
except ImportError:
|
1522
|
-
_BaseGenericAlias = typing._GenericAlias
|
1523
|
-
try:
|
1524
|
-
# 3.9+
|
1525
|
-
from typing import GenericAlias as _typing_GenericAlias
|
1526
|
-
except ImportError:
|
1527
|
-
_typing_GenericAlias = typing._GenericAlias
|
1528
|
-
|
1529
1490
|
def get_origin(tp):
|
1530
1491
|
"""Get the unsubscripted version of a type.
|
1531
1492
|
|
@@ -1541,9 +1502,9 @@ else:
|
|
1541
1502
|
get_origin(List[Tuple[T, T]][int]) == list
|
1542
1503
|
get_origin(P.args) is P
|
1543
1504
|
"""
|
1544
|
-
if isinstance(tp, _AnnotatedAlias):
|
1505
|
+
if isinstance(tp, typing._AnnotatedAlias):
|
1545
1506
|
return Annotated
|
1546
|
-
if isinstance(tp, (typing.
|
1507
|
+
if isinstance(tp, (typing._BaseGenericAlias, _types.GenericAlias,
|
1547
1508
|
ParamSpecArgs, ParamSpecKwargs)):
|
1548
1509
|
return tp.__origin__
|
1549
1510
|
if tp is typing.Generic:
|
@@ -1561,11 +1522,9 @@ else:
|
|
1561
1522
|
get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
|
1562
1523
|
get_args(Callable[[], T][int]) == ([], int)
|
1563
1524
|
"""
|
1564
|
-
if isinstance(tp, _AnnotatedAlias):
|
1525
|
+
if isinstance(tp, typing._AnnotatedAlias):
|
1565
1526
|
return (tp.__origin__, *tp.__metadata__)
|
1566
|
-
if isinstance(tp, (typing._GenericAlias,
|
1567
|
-
if getattr(tp, "_special", False):
|
1568
|
-
return ()
|
1527
|
+
if isinstance(tp, (typing._GenericAlias, _types.GenericAlias)):
|
1569
1528
|
res = tp.__args__
|
1570
1529
|
if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
|
1571
1530
|
res = (list(res[:-1]), res[-1])
|
@@ -1577,7 +1536,7 @@ else:
|
|
1577
1536
|
if hasattr(typing, 'TypeAlias'):
|
1578
1537
|
TypeAlias = typing.TypeAlias
|
1579
1538
|
# 3.9
|
1580
|
-
|
1539
|
+
else:
|
1581
1540
|
@_ExtensionsSpecialForm
|
1582
1541
|
def TypeAlias(self, parameters):
|
1583
1542
|
"""Special marker indicating that an assignment should
|
@@ -1591,21 +1550,6 @@ elif sys.version_info[:2] >= (3, 9):
|
|
1591
1550
|
It's invalid when used anywhere except as in the example above.
|
1592
1551
|
"""
|
1593
1552
|
raise TypeError(f"{self} is not subscriptable")
|
1594
|
-
# 3.8
|
1595
|
-
else:
|
1596
|
-
TypeAlias = _ExtensionsSpecialForm(
|
1597
|
-
'TypeAlias',
|
1598
|
-
doc="""Special marker indicating that an assignment should
|
1599
|
-
be recognized as a proper type alias definition by type
|
1600
|
-
checkers.
|
1601
|
-
|
1602
|
-
For example::
|
1603
|
-
|
1604
|
-
Predicate: TypeAlias = Callable[..., bool]
|
1605
|
-
|
1606
|
-
It's invalid when used anywhere except as in the example
|
1607
|
-
above."""
|
1608
|
-
)
|
1609
1553
|
|
1610
1554
|
|
1611
1555
|
def _set_default(type_param, default):
|
@@ -1615,7 +1559,7 @@ def _set_default(type_param, default):
|
|
1615
1559
|
|
1616
1560
|
def _set_module(typevarlike):
|
1617
1561
|
# for pickling:
|
1618
|
-
def_mod = _caller(depth=
|
1562
|
+
def_mod = _caller(depth=2)
|
1619
1563
|
if def_mod != 'typing_extensions':
|
1620
1564
|
typevarlike.__module__ = def_mod
|
1621
1565
|
|
@@ -1679,7 +1623,7 @@ else:
|
|
1679
1623
|
if hasattr(typing, 'ParamSpecArgs'):
|
1680
1624
|
ParamSpecArgs = typing.ParamSpecArgs
|
1681
1625
|
ParamSpecKwargs = typing.ParamSpecKwargs
|
1682
|
-
# 3.
|
1626
|
+
# 3.9
|
1683
1627
|
else:
|
1684
1628
|
class _Immutable:
|
1685
1629
|
"""Mixin to indicate that object should not be copied."""
|
@@ -1790,7 +1734,7 @@ elif hasattr(typing, 'ParamSpec'):
|
|
1790
1734
|
def __init_subclass__(cls) -> None:
|
1791
1735
|
raise TypeError(f"type '{__name__}.ParamSpec' is not an acceptable base type")
|
1792
1736
|
|
1793
|
-
# 3.
|
1737
|
+
# 3.9
|
1794
1738
|
else:
|
1795
1739
|
|
1796
1740
|
# Inherits from list as a workaround for Callable checks in Python < 3.9.2.
|
@@ -1895,7 +1839,7 @@ else:
|
|
1895
1839
|
pass
|
1896
1840
|
|
1897
1841
|
|
1898
|
-
# 3.
|
1842
|
+
# 3.9
|
1899
1843
|
if not hasattr(typing, 'Concatenate'):
|
1900
1844
|
# Inherits from list as a workaround for Callable checks in Python < 3.9.2.
|
1901
1845
|
|
@@ -1920,9 +1864,6 @@ if not hasattr(typing, 'Concatenate'):
|
|
1920
1864
|
# Trick Generic into looking into this for __parameters__.
|
1921
1865
|
__class__ = typing._GenericAlias
|
1922
1866
|
|
1923
|
-
# Flag in 3.8.
|
1924
|
-
_special = False
|
1925
|
-
|
1926
1867
|
def __init__(self, origin, args):
|
1927
1868
|
super().__init__(args)
|
1928
1869
|
self.__origin__ = origin
|
@@ -1946,7 +1887,6 @@ if not hasattr(typing, 'Concatenate'):
|
|
1946
1887
|
tp for tp in self.__args__ if isinstance(tp, (typing.TypeVar, ParamSpec))
|
1947
1888
|
)
|
1948
1889
|
|
1949
|
-
# 3.8; needed for typing._subst_tvars
|
1950
1890
|
# 3.9 used by __getitem__ below
|
1951
1891
|
def copy_with(self, params):
|
1952
1892
|
if isinstance(params[-1], _ConcatenateGenericAlias):
|
@@ -1974,7 +1914,7 @@ if not hasattr(typing, 'Concatenate'):
|
|
1974
1914
|
prepare = getattr(param, "__typing_prepare_subst__", None)
|
1975
1915
|
if prepare is not None:
|
1976
1916
|
args = prepare(self, args)
|
1977
|
-
# 3.
|
1917
|
+
# 3.9 & typing.ParamSpec
|
1978
1918
|
elif isinstance(param, ParamSpec):
|
1979
1919
|
i = params.index(param)
|
1980
1920
|
if (
|
@@ -1990,7 +1930,7 @@ if not hasattr(typing, 'Concatenate'):
|
|
1990
1930
|
args = (args,)
|
1991
1931
|
elif (
|
1992
1932
|
isinstance(args[i], list)
|
1993
|
-
# 3.
|
1933
|
+
# 3.9
|
1994
1934
|
# This class inherits from list do not convert
|
1995
1935
|
and not isinstance(args[i], _ConcatenateGenericAlias)
|
1996
1936
|
):
|
@@ -2063,16 +2003,16 @@ else:
|
|
2063
2003
|
return value
|
2064
2004
|
|
2065
2005
|
|
2066
|
-
# 3.
|
2006
|
+
# 3.9.2
|
2067
2007
|
class _EllipsisDummy: ...
|
2068
2008
|
|
2069
2009
|
|
2070
|
-
# 3.
|
2010
|
+
# <=3.10
|
2071
2011
|
def _create_concatenate_alias(origin, parameters):
|
2072
2012
|
if parameters[-1] is ... and sys.version_info < (3, 9, 2):
|
2073
2013
|
# Hack: Arguments must be types, replace it with one.
|
2074
2014
|
parameters = (*parameters[:-1], _EllipsisDummy)
|
2075
|
-
if sys.version_info >= (3, 10,
|
2015
|
+
if sys.version_info >= (3, 10, 3):
|
2076
2016
|
concatenate = _ConcatenateGenericAlias(origin, parameters,
|
2077
2017
|
_typevar_types=(TypeVar, ParamSpec),
|
2078
2018
|
_paramspec_tvars=True)
|
@@ -2091,7 +2031,7 @@ def _create_concatenate_alias(origin, parameters):
|
|
2091
2031
|
return concatenate
|
2092
2032
|
|
2093
2033
|
|
2094
|
-
# 3.
|
2034
|
+
# <=3.10
|
2095
2035
|
@typing._tp_cache
|
2096
2036
|
def _concatenate_getitem(self, parameters):
|
2097
2037
|
if parameters == ():
|
@@ -2110,8 +2050,8 @@ def _concatenate_getitem(self, parameters):
|
|
2110
2050
|
# 3.11+; Concatenate does not accept ellipsis in 3.10
|
2111
2051
|
if sys.version_info >= (3, 11):
|
2112
2052
|
Concatenate = typing.Concatenate
|
2113
|
-
# 3.
|
2114
|
-
|
2053
|
+
# <=3.10
|
2054
|
+
else:
|
2115
2055
|
@_ExtensionsSpecialForm
|
2116
2056
|
def Concatenate(self, parameters):
|
2117
2057
|
"""Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
|
@@ -2125,30 +2065,13 @@ elif sys.version_info[:2] >= (3, 9):
|
|
2125
2065
|
See PEP 612 for detailed information.
|
2126
2066
|
"""
|
2127
2067
|
return _concatenate_getitem(self, parameters)
|
2128
|
-
# 3.8
|
2129
|
-
else:
|
2130
|
-
class _ConcatenateForm(_ExtensionsSpecialForm, _root=True):
|
2131
|
-
def __getitem__(self, parameters):
|
2132
|
-
return _concatenate_getitem(self, parameters)
|
2133
2068
|
|
2134
|
-
Concatenate = _ConcatenateForm(
|
2135
|
-
'Concatenate',
|
2136
|
-
doc="""Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
|
2137
|
-
higher order function which adds, removes or transforms parameters of a
|
2138
|
-
callable.
|
2139
|
-
|
2140
|
-
For example::
|
2141
|
-
|
2142
|
-
Callable[Concatenate[int, P], int]
|
2143
|
-
|
2144
|
-
See PEP 612 for detailed information.
|
2145
|
-
""")
|
2146
2069
|
|
2147
2070
|
# 3.10+
|
2148
2071
|
if hasattr(typing, 'TypeGuard'):
|
2149
2072
|
TypeGuard = typing.TypeGuard
|
2150
2073
|
# 3.9
|
2151
|
-
|
2074
|
+
else:
|
2152
2075
|
@_ExtensionsSpecialForm
|
2153
2076
|
def TypeGuard(self, parameters):
|
2154
2077
|
"""Special typing form used to annotate the return type of a user-defined
|
@@ -2195,64 +2118,13 @@ elif sys.version_info[:2] >= (3, 9):
|
|
2195
2118
|
"""
|
2196
2119
|
item = typing._type_check(parameters, f'{self} accepts only a single type.')
|
2197
2120
|
return typing._GenericAlias(self, (item,))
|
2198
|
-
# 3.8
|
2199
|
-
else:
|
2200
|
-
class _TypeGuardForm(_ExtensionsSpecialForm, _root=True):
|
2201
|
-
def __getitem__(self, parameters):
|
2202
|
-
item = typing._type_check(parameters,
|
2203
|
-
f'{self._name} accepts only a single type')
|
2204
|
-
return typing._GenericAlias(self, (item,))
|
2205
|
-
|
2206
|
-
TypeGuard = _TypeGuardForm(
|
2207
|
-
'TypeGuard',
|
2208
|
-
doc="""Special typing form used to annotate the return type of a user-defined
|
2209
|
-
type guard function. ``TypeGuard`` only accepts a single type argument.
|
2210
|
-
At runtime, functions marked this way should return a boolean.
|
2211
|
-
|
2212
|
-
``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
|
2213
|
-
type checkers to determine a more precise type of an expression within a
|
2214
|
-
program's code flow. Usually type narrowing is done by analyzing
|
2215
|
-
conditional code flow and applying the narrowing to a block of code. The
|
2216
|
-
conditional expression here is sometimes referred to as a "type guard".
|
2217
|
-
|
2218
|
-
Sometimes it would be convenient to use a user-defined boolean function
|
2219
|
-
as a type guard. Such a function should use ``TypeGuard[...]`` as its
|
2220
|
-
return type to alert static type checkers to this intention.
|
2221
2121
|
|
2222
|
-
Using ``-> TypeGuard`` tells the static type checker that for a given
|
2223
|
-
function:
|
2224
|
-
|
2225
|
-
1. The return value is a boolean.
|
2226
|
-
2. If the return value is ``True``, the type of its argument
|
2227
|
-
is the type inside ``TypeGuard``.
|
2228
|
-
|
2229
|
-
For example::
|
2230
|
-
|
2231
|
-
def is_str(val: Union[str, float]):
|
2232
|
-
# "isinstance" type guard
|
2233
|
-
if isinstance(val, str):
|
2234
|
-
# Type of ``val`` is narrowed to ``str``
|
2235
|
-
...
|
2236
|
-
else:
|
2237
|
-
# Else, type of ``val`` is narrowed to ``float``.
|
2238
|
-
...
|
2239
|
-
|
2240
|
-
Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
|
2241
|
-
form of ``TypeA`` (it can even be a wider form) and this may lead to
|
2242
|
-
type-unsafe results. The main reason is to allow for things like
|
2243
|
-
narrowing ``List[object]`` to ``List[str]`` even though the latter is not
|
2244
|
-
a subtype of the former, since ``List`` is invariant. The responsibility of
|
2245
|
-
writing type-safe type guards is left to the user.
|
2246
|
-
|
2247
|
-
``TypeGuard`` also works with type variables. For more information, see
|
2248
|
-
PEP 647 (User-Defined Type Guards).
|
2249
|
-
""")
|
2250
2122
|
|
2251
2123
|
# 3.13+
|
2252
2124
|
if hasattr(typing, 'TypeIs'):
|
2253
2125
|
TypeIs = typing.TypeIs
|
2254
|
-
# 3.
|
2255
|
-
|
2126
|
+
# <=3.12
|
2127
|
+
else:
|
2256
2128
|
@_ExtensionsSpecialForm
|
2257
2129
|
def TypeIs(self, parameters):
|
2258
2130
|
"""Special typing form used to annotate the return type of a user-defined
|
@@ -2293,58 +2165,13 @@ elif sys.version_info[:2] >= (3, 9):
|
|
2293
2165
|
"""
|
2294
2166
|
item = typing._type_check(parameters, f'{self} accepts only a single type.')
|
2295
2167
|
return typing._GenericAlias(self, (item,))
|
2296
|
-
# 3.8
|
2297
|
-
else:
|
2298
|
-
class _TypeIsForm(_ExtensionsSpecialForm, _root=True):
|
2299
|
-
def __getitem__(self, parameters):
|
2300
|
-
item = typing._type_check(parameters,
|
2301
|
-
f'{self._name} accepts only a single type')
|
2302
|
-
return typing._GenericAlias(self, (item,))
|
2303
2168
|
|
2304
|
-
TypeIs = _TypeIsForm(
|
2305
|
-
'TypeIs',
|
2306
|
-
doc="""Special typing form used to annotate the return type of a user-defined
|
2307
|
-
type narrower function. ``TypeIs`` only accepts a single type argument.
|
2308
|
-
At runtime, functions marked this way should return a boolean.
|
2309
|
-
|
2310
|
-
``TypeIs`` aims to benefit *type narrowing* -- a technique used by static
|
2311
|
-
type checkers to determine a more precise type of an expression within a
|
2312
|
-
program's code flow. Usually type narrowing is done by analyzing
|
2313
|
-
conditional code flow and applying the narrowing to a block of code. The
|
2314
|
-
conditional expression here is sometimes referred to as a "type guard".
|
2315
|
-
|
2316
|
-
Sometimes it would be convenient to use a user-defined boolean function
|
2317
|
-
as a type guard. Such a function should use ``TypeIs[...]`` as its
|
2318
|
-
return type to alert static type checkers to this intention.
|
2319
|
-
|
2320
|
-
Using ``-> TypeIs`` tells the static type checker that for a given
|
2321
|
-
function:
|
2322
|
-
|
2323
|
-
1. The return value is a boolean.
|
2324
|
-
2. If the return value is ``True``, the type of its argument
|
2325
|
-
is the intersection of the type inside ``TypeIs`` and the argument's
|
2326
|
-
previously known type.
|
2327
|
-
|
2328
|
-
For example::
|
2329
|
-
|
2330
|
-
def is_awaitable(val: object) -> TypeIs[Awaitable[Any]]:
|
2331
|
-
return hasattr(val, '__await__')
|
2332
|
-
|
2333
|
-
def f(val: Union[int, Awaitable[int]]) -> int:
|
2334
|
-
if is_awaitable(val):
|
2335
|
-
assert_type(val, Awaitable[int])
|
2336
|
-
else:
|
2337
|
-
assert_type(val, int)
|
2338
|
-
|
2339
|
-
``TypeIs`` also works with type variables. For more information, see
|
2340
|
-
PEP 742 (Narrowing types with TypeIs).
|
2341
|
-
""")
|
2342
2169
|
|
2343
2170
|
# 3.14+?
|
2344
2171
|
if hasattr(typing, 'TypeForm'):
|
2345
2172
|
TypeForm = typing.TypeForm
|
2346
|
-
# 3.
|
2347
|
-
|
2173
|
+
# <=3.13
|
2174
|
+
else:
|
2348
2175
|
class _TypeFormForm(_ExtensionsSpecialForm, _root=True):
|
2349
2176
|
# TypeForm(X) is equivalent to X but indicates to the type checker
|
2350
2177
|
# that the object is a TypeForm.
|
@@ -2372,36 +2199,6 @@ elif sys.version_info[:2] >= (3, 9):
|
|
2372
2199
|
"""
|
2373
2200
|
item = typing._type_check(parameters, f'{self} accepts only a single type.')
|
2374
2201
|
return typing._GenericAlias(self, (item,))
|
2375
|
-
# 3.8
|
2376
|
-
else:
|
2377
|
-
class _TypeFormForm(_ExtensionsSpecialForm, _root=True):
|
2378
|
-
def __getitem__(self, parameters):
|
2379
|
-
item = typing._type_check(parameters,
|
2380
|
-
f'{self._name} accepts only a single type')
|
2381
|
-
return typing._GenericAlias(self, (item,))
|
2382
|
-
|
2383
|
-
def __call__(self, obj, /):
|
2384
|
-
return obj
|
2385
|
-
|
2386
|
-
TypeForm = _TypeFormForm(
|
2387
|
-
'TypeForm',
|
2388
|
-
doc="""A special form representing the value that results from the evaluation
|
2389
|
-
of a type expression. This value encodes the information supplied in the
|
2390
|
-
type expression, and it represents the type described by that type expression.
|
2391
|
-
|
2392
|
-
When used in a type expression, TypeForm describes a set of type form objects.
|
2393
|
-
It accepts a single type argument, which must be a valid type expression.
|
2394
|
-
``TypeForm[T]`` describes the set of all type form objects that represent
|
2395
|
-
the type T or types that are assignable to T.
|
2396
|
-
|
2397
|
-
Usage:
|
2398
|
-
|
2399
|
-
def cast[T](typ: TypeForm[T], value: Any) -> T: ...
|
2400
|
-
|
2401
|
-
reveal_type(cast(int, "x")) # int
|
2402
|
-
|
2403
|
-
See PEP 747 for more information.
|
2404
|
-
""")
|
2405
2202
|
|
2406
2203
|
|
2407
2204
|
# Vendored from cpython typing._SpecialFrom
|
@@ -2525,7 +2322,7 @@ else:
|
|
2525
2322
|
if hasattr(typing, 'Required'): # 3.11+
|
2526
2323
|
Required = typing.Required
|
2527
2324
|
NotRequired = typing.NotRequired
|
2528
|
-
|
2325
|
+
else: # <=3.10
|
2529
2326
|
@_ExtensionsSpecialForm
|
2530
2327
|
def Required(self, parameters):
|
2531
2328
|
"""A special typing construct to mark a key of a total=False TypedDict
|
@@ -2563,49 +2360,10 @@ elif sys.version_info[:2] >= (3, 9): # 3.9-3.10
|
|
2563
2360
|
item = typing._type_check(parameters, f'{self._name} accepts only a single type.')
|
2564
2361
|
return typing._GenericAlias(self, (item,))
|
2565
2362
|
|
2566
|
-
else: # 3.8
|
2567
|
-
class _RequiredForm(_ExtensionsSpecialForm, _root=True):
|
2568
|
-
def __getitem__(self, parameters):
|
2569
|
-
item = typing._type_check(parameters,
|
2570
|
-
f'{self._name} accepts only a single type.')
|
2571
|
-
return typing._GenericAlias(self, (item,))
|
2572
|
-
|
2573
|
-
Required = _RequiredForm(
|
2574
|
-
'Required',
|
2575
|
-
doc="""A special typing construct to mark a key of a total=False TypedDict
|
2576
|
-
as required. For example:
|
2577
|
-
|
2578
|
-
class Movie(TypedDict, total=False):
|
2579
|
-
title: Required[str]
|
2580
|
-
year: int
|
2581
|
-
|
2582
|
-
m = Movie(
|
2583
|
-
title='The Matrix', # typechecker error if key is omitted
|
2584
|
-
year=1999,
|
2585
|
-
)
|
2586
|
-
|
2587
|
-
There is no runtime checking that a required key is actually provided
|
2588
|
-
when instantiating a related TypedDict.
|
2589
|
-
""")
|
2590
|
-
NotRequired = _RequiredForm(
|
2591
|
-
'NotRequired',
|
2592
|
-
doc="""A special typing construct to mark a key of a TypedDict as
|
2593
|
-
potentially missing. For example:
|
2594
|
-
|
2595
|
-
class Movie(TypedDict):
|
2596
|
-
title: str
|
2597
|
-
year: NotRequired[int]
|
2598
|
-
|
2599
|
-
m = Movie(
|
2600
|
-
title='The Matrix', # typechecker error if key is omitted
|
2601
|
-
year=1999,
|
2602
|
-
)
|
2603
|
-
""")
|
2604
|
-
|
2605
2363
|
|
2606
2364
|
if hasattr(typing, 'ReadOnly'):
|
2607
2365
|
ReadOnly = typing.ReadOnly
|
2608
|
-
|
2366
|
+
else: # <=3.12
|
2609
2367
|
@_ExtensionsSpecialForm
|
2610
2368
|
def ReadOnly(self, parameters):
|
2611
2369
|
"""A special typing construct to mark an item of a TypedDict as read-only.
|
@@ -2625,30 +2383,6 @@ elif sys.version_info[:2] >= (3, 9): # 3.9-3.12
|
|
2625
2383
|
item = typing._type_check(parameters, f'{self._name} accepts only a single type.')
|
2626
2384
|
return typing._GenericAlias(self, (item,))
|
2627
2385
|
|
2628
|
-
else: # 3.8
|
2629
|
-
class _ReadOnlyForm(_ExtensionsSpecialForm, _root=True):
|
2630
|
-
def __getitem__(self, parameters):
|
2631
|
-
item = typing._type_check(parameters,
|
2632
|
-
f'{self._name} accepts only a single type.')
|
2633
|
-
return typing._GenericAlias(self, (item,))
|
2634
|
-
|
2635
|
-
ReadOnly = _ReadOnlyForm(
|
2636
|
-
'ReadOnly',
|
2637
|
-
doc="""A special typing construct to mark a key of a TypedDict as read-only.
|
2638
|
-
|
2639
|
-
For example:
|
2640
|
-
|
2641
|
-
class Movie(TypedDict):
|
2642
|
-
title: ReadOnly[str]
|
2643
|
-
year: int
|
2644
|
-
|
2645
|
-
def mutate_movie(m: Movie) -> None:
|
2646
|
-
m["year"] = 1992 # allowed
|
2647
|
-
m["title"] = "The Matrix" # typechecker error
|
2648
|
-
|
2649
|
-
There is no runtime checking for this propery.
|
2650
|
-
""")
|
2651
|
-
|
2652
2386
|
|
2653
2387
|
_UNPACK_DOC = """\
|
2654
2388
|
Type unpack operator.
|
@@ -2698,7 +2432,7 @@ if sys.version_info >= (3, 12): # PEP 692 changed the repr of Unpack[]
|
|
2698
2432
|
def _is_unpack(obj):
|
2699
2433
|
return get_origin(obj) is Unpack
|
2700
2434
|
|
2701
|
-
|
2435
|
+
else: # <=3.11
|
2702
2436
|
class _UnpackSpecialForm(_ExtensionsSpecialForm, _root=True):
|
2703
2437
|
def __init__(self, getitem):
|
2704
2438
|
super().__init__(getitem)
|
@@ -2739,43 +2473,6 @@ elif sys.version_info[:2] >= (3, 9): # 3.9+
|
|
2739
2473
|
def _is_unpack(obj):
|
2740
2474
|
return isinstance(obj, _UnpackAlias)
|
2741
2475
|
|
2742
|
-
else: # 3.8
|
2743
|
-
class _UnpackAlias(typing._GenericAlias, _root=True):
|
2744
|
-
__class__ = typing.TypeVar
|
2745
|
-
|
2746
|
-
@property
|
2747
|
-
def __typing_unpacked_tuple_args__(self):
|
2748
|
-
assert self.__origin__ is Unpack
|
2749
|
-
assert len(self.__args__) == 1
|
2750
|
-
arg, = self.__args__
|
2751
|
-
if isinstance(arg, typing._GenericAlias):
|
2752
|
-
if arg.__origin__ is not tuple:
|
2753
|
-
raise TypeError("Unpack[...] must be used with a tuple type")
|
2754
|
-
return arg.__args__
|
2755
|
-
return None
|
2756
|
-
|
2757
|
-
@property
|
2758
|
-
def __typing_is_unpacked_typevartuple__(self):
|
2759
|
-
assert self.__origin__ is Unpack
|
2760
|
-
assert len(self.__args__) == 1
|
2761
|
-
return isinstance(self.__args__[0], TypeVarTuple)
|
2762
|
-
|
2763
|
-
def __getitem__(self, args):
|
2764
|
-
if self.__typing_is_unpacked_typevartuple__:
|
2765
|
-
return args
|
2766
|
-
return super().__getitem__(args)
|
2767
|
-
|
2768
|
-
class _UnpackForm(_ExtensionsSpecialForm, _root=True):
|
2769
|
-
def __getitem__(self, parameters):
|
2770
|
-
item = typing._type_check(parameters,
|
2771
|
-
f'{self._name} accepts only a single type.')
|
2772
|
-
return _UnpackAlias(self, (item,))
|
2773
|
-
|
2774
|
-
Unpack = _UnpackForm('Unpack', doc=_UNPACK_DOC)
|
2775
|
-
|
2776
|
-
def _is_unpack(obj):
|
2777
|
-
return isinstance(obj, _UnpackAlias)
|
2778
|
-
|
2779
2476
|
|
2780
2477
|
def _unpack_args(*args):
|
2781
2478
|
newargs = []
|
@@ -3123,7 +2820,8 @@ else: # <=3.11
|
|
3123
2820
|
return arg
|
3124
2821
|
|
3125
2822
|
|
3126
|
-
|
2823
|
+
# Python 3.13.3+ contains a fix for the wrapped __new__
|
2824
|
+
if sys.version_info >= (3, 13, 3):
|
3127
2825
|
deprecated = warnings.deprecated
|
3128
2826
|
else:
|
3129
2827
|
_T = typing.TypeVar("_T")
|
@@ -3203,7 +2901,7 @@ else:
|
|
3203
2901
|
original_new = arg.__new__
|
3204
2902
|
|
3205
2903
|
@functools.wraps(original_new)
|
3206
|
-
def __new__(cls, *args, **kwargs):
|
2904
|
+
def __new__(cls, /, *args, **kwargs):
|
3207
2905
|
if cls is arg:
|
3208
2906
|
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
|
3209
2907
|
if original_new is not object.__new__:
|
@@ -3544,10 +3242,6 @@ else:
|
|
3544
3242
|
nm_tpl = collections.namedtuple(name, fields,
|
3545
3243
|
defaults=defaults, module=module)
|
3546
3244
|
nm_tpl.__annotations__ = nm_tpl.__new__.__annotations__ = annotations
|
3547
|
-
# The `_field_types` attribute was removed in 3.9;
|
3548
|
-
# in earlier versions, it is the same as the `__annotations__` attribute
|
3549
|
-
if sys.version_info < (3, 9):
|
3550
|
-
nm_tpl._field_types = annotations
|
3551
3245
|
return nm_tpl
|
3552
3246
|
|
3553
3247
|
_prohibited_namedtuple_fields = typing._prohibited
|
@@ -3629,7 +3323,6 @@ else:
|
|
3629
3323
|
assert NamedTuple in bases
|
3630
3324
|
return (_NamedTuple,)
|
3631
3325
|
|
3632
|
-
@_ensure_subclassable(_namedtuple_mro_entries)
|
3633
3326
|
def NamedTuple(typename, fields=_marker, /, **kwargs):
|
3634
3327
|
"""Typed version of namedtuple.
|
3635
3328
|
|
@@ -3695,6 +3388,8 @@ else:
|
|
3695
3388
|
nt.__orig_bases__ = (NamedTuple,)
|
3696
3389
|
return nt
|
3697
3390
|
|
3391
|
+
NamedTuple.__mro_entries__ = _namedtuple_mro_entries
|
3392
|
+
|
3698
3393
|
|
3699
3394
|
if hasattr(collections.abc, "Buffer"):
|
3700
3395
|
Buffer = collections.abc.Buffer
|
@@ -3825,16 +3520,29 @@ else:
|
|
3825
3520
|
|
3826
3521
|
if sys.version_info >= (3, 14):
|
3827
3522
|
TypeAliasType = typing.TypeAliasType
|
3828
|
-
# 3.
|
3523
|
+
# <=3.13
|
3829
3524
|
else:
|
3830
|
-
|
3831
|
-
|
3832
|
-
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
3836
|
-
|
3837
|
-
|
3525
|
+
if sys.version_info >= (3, 12):
|
3526
|
+
# 3.12-3.13
|
3527
|
+
def _is_unionable(obj):
|
3528
|
+
"""Corresponds to is_unionable() in unionobject.c in CPython."""
|
3529
|
+
return obj is None or isinstance(obj, (
|
3530
|
+
type,
|
3531
|
+
_types.GenericAlias,
|
3532
|
+
_types.UnionType,
|
3533
|
+
typing.TypeAliasType,
|
3534
|
+
TypeAliasType,
|
3535
|
+
))
|
3536
|
+
else:
|
3537
|
+
# <=3.11
|
3538
|
+
def _is_unionable(obj):
|
3539
|
+
"""Corresponds to is_unionable() in unionobject.c in CPython."""
|
3540
|
+
return obj is None or isinstance(obj, (
|
3541
|
+
type,
|
3542
|
+
_types.GenericAlias,
|
3543
|
+
_types.UnionType,
|
3544
|
+
TypeAliasType,
|
3545
|
+
))
|
3838
3546
|
|
3839
3547
|
if sys.version_info < (3, 10):
|
3840
3548
|
# Copied and pasted from https://github.com/python/cpython/blob/986a4e1b6fcae7fe7a1d0a26aea446107dd58dd2/Objects/genericaliasobject.c#L568-L582,
|
@@ -3861,11 +3569,6 @@ else:
|
|
3861
3569
|
return object.__getattr__(self, attr)
|
3862
3570
|
return getattr(self.__origin__, attr)
|
3863
3571
|
|
3864
|
-
if sys.version_info < (3, 9):
|
3865
|
-
def __getitem__(self, item):
|
3866
|
-
result = super().__getitem__(item)
|
3867
|
-
result.__class__ = type(self)
|
3868
|
-
return result
|
3869
3572
|
|
3870
3573
|
class TypeAliasType:
|
3871
3574
|
"""Create named, parameterized type aliases.
|
@@ -3908,7 +3611,7 @@ else:
|
|
3908
3611
|
for type_param in type_params:
|
3909
3612
|
if (
|
3910
3613
|
not isinstance(type_param, (TypeVar, TypeVarTuple, ParamSpec))
|
3911
|
-
# 3.
|
3614
|
+
# <=3.11
|
3912
3615
|
# Unpack Backport passes isinstance(type_param, TypeVar)
|
3913
3616
|
or _is_unpack(type_param)
|
3914
3617
|
):
|
@@ -4126,26 +3829,15 @@ if _CapsuleType is not None:
|
|
4126
3829
|
__all__.append("CapsuleType")
|
4127
3830
|
|
4128
3831
|
|
4129
|
-
|
4130
|
-
|
4131
|
-
# some other variation: in any case, inspect.get_annotations
|
4132
|
-
# will continue to exist and will gain a `format` parameter.
|
4133
|
-
_PEP_649_OR_749_IMPLEMENTED = (
|
4134
|
-
hasattr(inspect, 'get_annotations')
|
4135
|
-
and inspect.get_annotations.__kwdefaults__ is not None
|
4136
|
-
and "format" in inspect.get_annotations.__kwdefaults__
|
4137
|
-
)
|
4138
|
-
|
4139
|
-
|
4140
|
-
class Format(enum.IntEnum):
|
4141
|
-
VALUE = 1
|
4142
|
-
FORWARDREF = 2
|
4143
|
-
STRING = 3
|
4144
|
-
|
4145
|
-
|
4146
|
-
if _PEP_649_OR_749_IMPLEMENTED:
|
4147
|
-
get_annotations = inspect.get_annotations
|
3832
|
+
if sys.version_info >= (3,14):
|
3833
|
+
from annotationlib import Format, get_annotations
|
4148
3834
|
else:
|
3835
|
+
class Format(enum.IntEnum):
|
3836
|
+
VALUE = 1
|
3837
|
+
VALUE_WITH_FAKE_GLOBALS = 2
|
3838
|
+
FORWARDREF = 3
|
3839
|
+
STRING = 4
|
3840
|
+
|
4149
3841
|
def get_annotations(obj, *, globals=None, locals=None, eval_str=False,
|
4150
3842
|
format=Format.VALUE):
|
4151
3843
|
"""Compute the annotations dict for an object.
|
@@ -4184,6 +3876,10 @@ else:
|
|
4184
3876
|
|
4185
3877
|
"""
|
4186
3878
|
format = Format(format)
|
3879
|
+
if format is Format.VALUE_WITH_FAKE_GLOBALS:
|
3880
|
+
raise ValueError(
|
3881
|
+
"The VALUE_WITH_FAKE_GLOBALS format is for internal use only"
|
3882
|
+
)
|
4187
3883
|
|
4188
3884
|
if eval_str and format is not Format.VALUE:
|
4189
3885
|
raise ValueError("eval_str=True is only supported with format=Format.VALUE")
|
@@ -4364,53 +4060,6 @@ else:
|
|
4364
4060
|
forward_ref.__forward_value__ = value
|
4365
4061
|
return value
|
4366
4062
|
|
4367
|
-
def _lax_type_check(
|
4368
|
-
value, msg, is_argument=True, *, module=None, allow_special_forms=False
|
4369
|
-
):
|
4370
|
-
"""
|
4371
|
-
A lax Python 3.11+ like version of typing._type_check
|
4372
|
-
"""
|
4373
|
-
if hasattr(typing, "_type_convert"):
|
4374
|
-
if _FORWARD_REF_HAS_CLASS:
|
4375
|
-
type_ = typing._type_convert(
|
4376
|
-
value,
|
4377
|
-
module=module,
|
4378
|
-
allow_special_forms=allow_special_forms,
|
4379
|
-
)
|
4380
|
-
# module was added with bpo-41249 before is_class (bpo-46539)
|
4381
|
-
elif "__forward_module__" in typing.ForwardRef.__slots__:
|
4382
|
-
type_ = typing._type_convert(value, module=module)
|
4383
|
-
else:
|
4384
|
-
type_ = typing._type_convert(value)
|
4385
|
-
else:
|
4386
|
-
if value is None:
|
4387
|
-
return type(None)
|
4388
|
-
if isinstance(value, str):
|
4389
|
-
return ForwardRef(value)
|
4390
|
-
type_ = value
|
4391
|
-
invalid_generic_forms = (Generic, Protocol)
|
4392
|
-
if not allow_special_forms:
|
4393
|
-
invalid_generic_forms += (ClassVar,)
|
4394
|
-
if is_argument:
|
4395
|
-
invalid_generic_forms += (Final,)
|
4396
|
-
if (
|
4397
|
-
isinstance(type_, typing._GenericAlias)
|
4398
|
-
and get_origin(type_) in invalid_generic_forms
|
4399
|
-
):
|
4400
|
-
raise TypeError(f"{type_} is not valid as type argument") from None
|
4401
|
-
if type_ in (Any, LiteralString, NoReturn, Never, Self, TypeAlias):
|
4402
|
-
return type_
|
4403
|
-
if allow_special_forms and type_ in (ClassVar, Final):
|
4404
|
-
return type_
|
4405
|
-
if (
|
4406
|
-
isinstance(type_, (_SpecialForm, typing._SpecialForm))
|
4407
|
-
or type_ in (Generic, Protocol)
|
4408
|
-
):
|
4409
|
-
raise TypeError(f"Plain {type_} is not valid as type argument") from None
|
4410
|
-
if type(type_) is tuple: # lax version with tuple instead of callable
|
4411
|
-
raise TypeError(f"{msg} Got {type_!r:.100}.")
|
4412
|
-
return type_
|
4413
|
-
|
4414
4063
|
def evaluate_forward_ref(
|
4415
4064
|
forward_ref,
|
4416
4065
|
*,
|
@@ -4418,7 +4067,7 @@ else:
|
|
4418
4067
|
globals=None,
|
4419
4068
|
locals=None,
|
4420
4069
|
type_params=None,
|
4421
|
-
format=
|
4070
|
+
format=None,
|
4422
4071
|
_recursive_guard=frozenset(),
|
4423
4072
|
):
|
4424
4073
|
"""Evaluate a forward reference as a type hint.
|
@@ -4463,24 +4112,15 @@ else:
|
|
4463
4112
|
else:
|
4464
4113
|
raise
|
4465
4114
|
|
4466
|
-
|
4467
|
-
|
4468
|
-
allow_special_forms = not forward_ref.__forward_is_argument__
|
4469
|
-
else:
|
4470
|
-
allow_special_forms = forward_ref.__forward_is_class__
|
4471
|
-
type_ = _lax_type_check(
|
4472
|
-
value,
|
4473
|
-
msg,
|
4474
|
-
is_argument=forward_ref.__forward_is_argument__,
|
4475
|
-
allow_special_forms=allow_special_forms,
|
4476
|
-
)
|
4115
|
+
if isinstance(value, str):
|
4116
|
+
value = ForwardRef(value)
|
4477
4117
|
|
4478
4118
|
# Recursively evaluate the type
|
4479
|
-
if isinstance(
|
4480
|
-
if getattr(
|
4119
|
+
if isinstance(value, ForwardRef):
|
4120
|
+
if getattr(value, "__forward_module__", True) is not None:
|
4481
4121
|
globals = None
|
4482
4122
|
return evaluate_forward_ref(
|
4483
|
-
|
4123
|
+
value,
|
4484
4124
|
globals=globals,
|
4485
4125
|
locals=locals,
|
4486
4126
|
type_params=type_params, owner=owner,
|
@@ -4492,75 +4132,107 @@ else:
|
|
4492
4132
|
for tvar in type_params:
|
4493
4133
|
if tvar.__name__ not in locals: # lets not overwrite something present
|
4494
4134
|
locals[tvar.__name__] = tvar
|
4495
|
-
if sys.version_info < (3, 9):
|
4496
|
-
return typing._eval_type(
|
4497
|
-
type_,
|
4498
|
-
globals,
|
4499
|
-
locals,
|
4500
|
-
)
|
4501
4135
|
if sys.version_info < (3, 12, 5):
|
4502
4136
|
return typing._eval_type(
|
4503
|
-
|
4137
|
+
value,
|
4504
4138
|
globals,
|
4505
4139
|
locals,
|
4506
4140
|
recursive_guard=_recursive_guard | {forward_ref.__forward_arg__},
|
4507
4141
|
)
|
4508
|
-
|
4142
|
+
else:
|
4509
4143
|
return typing._eval_type(
|
4510
|
-
|
4144
|
+
value,
|
4511
4145
|
globals,
|
4512
4146
|
locals,
|
4513
4147
|
type_params,
|
4514
4148
|
recursive_guard=_recursive_guard | {forward_ref.__forward_arg__},
|
4515
4149
|
)
|
4516
|
-
return typing._eval_type(
|
4517
|
-
type_,
|
4518
|
-
globals,
|
4519
|
-
locals,
|
4520
|
-
type_params,
|
4521
|
-
recursive_guard=_recursive_guard | {forward_ref.__forward_arg__},
|
4522
|
-
format=format,
|
4523
|
-
owner=owner,
|
4524
|
-
)
|
4525
4150
|
|
4526
4151
|
|
4527
|
-
|
4528
|
-
|
4529
|
-
|
4530
|
-
|
4531
|
-
|
4532
|
-
|
4533
|
-
|
4534
|
-
|
4535
|
-
|
4536
|
-
|
4537
|
-
|
4538
|
-
|
4539
|
-
|
4152
|
+
class Sentinel:
|
4153
|
+
"""Create a unique sentinel object.
|
4154
|
+
|
4155
|
+
*name* should be the name of the variable to which the return value shall be assigned.
|
4156
|
+
|
4157
|
+
*repr*, if supplied, will be used for the repr of the sentinel object.
|
4158
|
+
If not provided, "<name>" will be used.
|
4159
|
+
"""
|
4160
|
+
|
4161
|
+
def __init__(
|
4162
|
+
self,
|
4163
|
+
name: str,
|
4164
|
+
repr: typing.Optional[str] = None,
|
4165
|
+
):
|
4166
|
+
self._name = name
|
4167
|
+
self._repr = repr if repr is not None else f'<{name}>'
|
4168
|
+
|
4169
|
+
def __repr__(self):
|
4170
|
+
return self._repr
|
4171
|
+
|
4172
|
+
if sys.version_info < (3, 11):
|
4173
|
+
# The presence of this method convinces typing._type_check
|
4174
|
+
# that Sentinels are types.
|
4175
|
+
def __call__(self, *args, **kwargs):
|
4176
|
+
raise TypeError(f"{type(self).__name__!r} object is not callable")
|
4177
|
+
|
4178
|
+
if sys.version_info >= (3, 10):
|
4179
|
+
def __or__(self, other):
|
4180
|
+
return typing.Union[self, other]
|
4181
|
+
|
4182
|
+
def __ror__(self, other):
|
4183
|
+
return typing.Union[other, self]
|
4184
|
+
|
4185
|
+
def __getstate__(self):
|
4186
|
+
raise TypeError(f"Cannot pickle {type(self).__name__!r} object")
|
4187
|
+
|
4188
|
+
|
4189
|
+
# Aliases for items that are in typing in all supported versions.
|
4190
|
+
# We use hasattr() checks so this library will continue to import on
|
4191
|
+
# future versions of Python that may remove these names.
|
4192
|
+
_typing_names = [
|
4193
|
+
"AbstractSet",
|
4194
|
+
"AnyStr",
|
4195
|
+
"BinaryIO",
|
4196
|
+
"Callable",
|
4197
|
+
"Collection",
|
4198
|
+
"Container",
|
4199
|
+
"Dict",
|
4200
|
+
"FrozenSet",
|
4201
|
+
"Hashable",
|
4202
|
+
"IO",
|
4203
|
+
"ItemsView",
|
4204
|
+
"Iterable",
|
4205
|
+
"Iterator",
|
4206
|
+
"KeysView",
|
4207
|
+
"List",
|
4208
|
+
"Mapping",
|
4209
|
+
"MappingView",
|
4210
|
+
"Match",
|
4211
|
+
"MutableMapping",
|
4212
|
+
"MutableSequence",
|
4213
|
+
"MutableSet",
|
4214
|
+
"Optional",
|
4215
|
+
"Pattern",
|
4216
|
+
"Reversible",
|
4217
|
+
"Sequence",
|
4218
|
+
"Set",
|
4219
|
+
"Sized",
|
4220
|
+
"TextIO",
|
4221
|
+
"Tuple",
|
4222
|
+
"Union",
|
4223
|
+
"ValuesView",
|
4224
|
+
"cast",
|
4225
|
+
"no_type_check",
|
4226
|
+
"no_type_check_decorator",
|
4227
|
+
# This is private, but it was defined by typing_extensions for a long time
|
4228
|
+
# and some users rely on it.
|
4229
|
+
"_AnnotatedAlias",
|
4230
|
+
]
|
4231
|
+
globals().update(
|
4232
|
+
{name: getattr(typing, name) for name in _typing_names if hasattr(typing, name)}
|
4233
|
+
)
|
4234
|
+
# These are defined unconditionally because they are used in
|
4235
|
+
# typing-extensions itself.
|
4540
4236
|
Generic = typing.Generic
|
4541
|
-
|
4542
|
-
|
4543
|
-
ItemsView = typing.ItemsView
|
4544
|
-
Iterable = typing.Iterable
|
4545
|
-
Iterator = typing.Iterator
|
4546
|
-
KeysView = typing.KeysView
|
4547
|
-
List = typing.List
|
4548
|
-
Mapping = typing.Mapping
|
4549
|
-
MappingView = typing.MappingView
|
4550
|
-
Match = typing.Match
|
4551
|
-
MutableMapping = typing.MutableMapping
|
4552
|
-
MutableSequence = typing.MutableSequence
|
4553
|
-
MutableSet = typing.MutableSet
|
4554
|
-
Optional = typing.Optional
|
4555
|
-
Pattern = typing.Pattern
|
4556
|
-
Reversible = typing.Reversible
|
4557
|
-
Sequence = typing.Sequence
|
4558
|
-
Set = typing.Set
|
4559
|
-
Sized = typing.Sized
|
4560
|
-
TextIO = typing.TextIO
|
4561
|
-
Tuple = typing.Tuple
|
4562
|
-
Union = typing.Union
|
4563
|
-
ValuesView = typing.ValuesView
|
4564
|
-
cast = typing.cast
|
4565
|
-
no_type_check = typing.no_type_check
|
4566
|
-
no_type_check_decorator = typing.no_type_check_decorator
|
4237
|
+
ForwardRef = typing.ForwardRef
|
4238
|
+
Annotated = typing.Annotated
|