Name | beartype JSON |
Version |
0.19.0
JSON |
| download |
home_page | None |
Summary | Unbearably fast near-real-time hybrid runtime-static type-checking in pure Python. |
upload_time | 2024-09-26 07:06:17 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2014-2024 Beartype authors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
annotations
python
type checking
type hints
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
.. # ------------------( LICENSE )------------------
.. # Copyright (c) 2014-2024 Beartype authors.
.. # See "LICENSE" for further details.
.. #
.. # ------------------( SEO )------------------
.. # Metadata converted into HTML-specific meta tags parsed by search engines.
.. # Note that:
.. # * The "description" should be no more than 300 characters and ideally no
.. # more than 150 characters, as search engines may silently truncate this
.. # description to 150 characters in edge cases.
.. meta::
:description lang=en:
Beartype is an open-source pure-Python PEP-compliant constant-time runtime
type checker emphasizing efficiency and portability.
.. # ------------------( SYNOPSIS )------------------
=================
|beartype-banner|
=================
|rtd-badge| |ci-badge| |codecov-badge|
⚠
`Beartype documentation lives at ReadTheDocs (RTD) <beartype RTD_>`__. It's
readable, structured, and soothing to the deep folds of your big galactic
brain. Open your mind to an ocean of mundane knowledge that will exhaust
you at work. Enter... **the Bearpedia:**
https://beartype.readthedocs.io
The document you are now reading was once a monolithic ~316Kb file known to
induce migraines in 22% of the whole devops population. For your safety,
that document no longer exists. This is how much beartype cares.
**Beartype** is an `open-source <beartype license_>`__ `pure-Python <beartype
pure_>`__ `PEP-compliant <beartype PEPs_>`__ `near-real-time <beartype FAQ_>`__
`hybrid runtime-static <beartype hybrid_>`__ `third-generation <beartype
third_>`__ `type checker <beartype ELI5_>`__ emphasizing efficiency,
usability, unsubstantiated jargon we just made up, and thrilling puns.
.. #FIXME: Once we actually receive a sponsor at this tier, please remove this
.. #placeholder as well as the icon links below. kthx
.. #The `Bear Team <beartype organization_>`__ gratefully thanks `our family of
.. #breathtaking GitHub Sponsors <beartype sponsorship_>`__:
.. #
.. #* **Your iconic URL here.** `Let us bestow you with eyeballs <beartype
.. # sponsorship_>`__.
.. #FIXME: Once we actually receive a sponsor at this tier, please remove this
.. #placeholder as well as the icon links below. kthx
.. # |icon-for-glorious-sponsor|
.. code-block:: bash
# Install beartype.
$ pip3 install beartype
# Edit the "{your_package}.__init__" submodule with your favourite IDE.
$ vim {your_package}/__init__.py # <-- so, i see that you too vim
.. code-block:: python
from beartype.claw import beartype_this_package # <-- hype comes
beartype_this_package() # <-- hype goes
Beartype now implicitly type-checks *all* annotated classes, callables, and
variable assignments across *all* submodules of your package. Congrats. This day
all bugs die.
But why stop at the burning tires in only *your* code? Your app depends on a
sprawling ghetto of other packages, modules, and services. How riddled with
infectious diseases is *that* code? You're about to find out.
.. code-block:: python
# ....................{ BIG BEAR }....................
# Warn about type hint violations in *OTHER* packages outside your control;
# only raise exceptions from violations in your package under your control.
# Again, at the very top of your "{your_package}.__init__" submodule:
from beartype import BeartypeConf # <-- this isn't your fault
from beartype.claw import beartype_all, beartype_this_package # <-- you didn't sign up for this
beartype_this_package() # <-- raise exceptions in your code
beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from other code
Beartype now implicitly type-checks *all* annotated classes, callables, and
variable assignments across *all* submodules of *all* packages. When **your**
package violates type safety, beartype raises an exception. When any **other**
package violates type safety, beartype just emits a warning. The triumphal
fanfare you hear is probably your userbase cheering. This is how the QA was won.
Beartype also publishes a `plethora of APIs for fine-grained control over
type-checking <beartype APIs>`. For those who are about to QA, beartype salutes
you. Would you like to know more?
# So let's do this.
$ python3
.. code-block:: python
# ....................{ RAISE THE PAW }....................
# Manually enforce type hints across individual classes and callables.
# Do this only if you want a(nother) repetitive stress injury.
# Import the @beartype decorator.
>>> from beartype import beartype # <-- eponymous import; it's eponymous
# Annotate @beartype-decorated classes and callables with type hints.
>>> @beartype # <-- you too will believe in magic
... def quote_wiggum(lines: list[str]) -> None:
... print('“{}”\n\t— Police Chief Wiggum'.format("\n ".join(lines)))
# Call those callables with valid parameters.
>>> quote_wiggum(["Okay, folks. Show's over!", " Nothing to see here. Show's…",])
“Okay, folks. Show's over!
Nothing to see here. Show's…”
— Police Chief Wiggum
# Call those callables with invalid parameters.
>>> quote_wiggum([b"Oh, my God! A horrible plane crash!", b"Hey, everybody! Get a load of this flaming wreckage!",])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 30, in quote_wiggum
File "/home/springfield/beartype/lib/python3.9/site-packages/beartype/_decor/_code/_pep/_error/errormain.py", line 220, in get_beartype_violation
raise exception_cls(
beartype.roar.BeartypeCallHintParamViolation: @beartyped
quote_wiggum() parameter lines=[b'Oh, my God! A horrible plane
crash!', b'Hey, everybody! Get a load of thi...'] violates type hint
list[str], as list item 0 value b'Oh, my God! A horrible plane crash!'
not str.
# ....................{ MAKE IT SO }....................
# Squash bugs by refining type hints with @beartype validators.
>>> from beartype.vale import Is # <---- validator factory
>>> from typing import Annotated # <---------------- if Python ≥ 3.9.0
# >>> from typing_extensions import Annotated # <-- if Python < 3.9.0
# Validators are type hints constrained by lambda functions.
>>> ListOfStrings = Annotated[ # <----- type hint matching non-empty list of strings
... list[str], # <----------------- type hint matching possibly empty list of strings
... Is[lambda lst: bool(lst)] # <-- lambda matching non-empty object
... ]
# Annotate @beartype-decorated callables with validators.
>>> @beartype
... def quote_wiggum_safer(lines: ListOfStrings) -> None:
... print('“{}”\n\t— Police Chief Wiggum'.format("\n ".join(lines)))
# Call those callables with invalid parameters.
>>> quote_wiggum_safer([])
beartype.roar.BeartypeCallHintParamViolation: @beartyped
quote_wiggum_safer() parameter lines=[] violates type hint
typing.Annotated[list[str], Is[lambda lst: bool(lst)]], as value []
violates validator Is[lambda lst: bool(lst)].
# ....................{ AT ANY TIME }....................
# Type-check anything against any type hint – anywhere at anytime.
>>> from beartype.door import (
... is_bearable, # <-------- like "isinstance(...)"
... die_if_unbearable, # <-- like "assert isinstance(...)"
... )
>>> is_bearable(['The', 'goggles', 'do', 'nothing.'], list[str])
True
>>> die_if_unbearable([0xCAFEBEEF, 0x8BADF00D], ListOfStrings)
beartype.roar.BeartypeDoorHintViolation: Object [3405692655, 2343432205]
violates type hint typing.Annotated[list[str], Is[lambda lst: bool(lst)]],
as list index 0 item 3405692655 not instance of str.
# ....................{ GO TO PLAID }....................
# Type-check anything in around 1µs (one millionth of a second) – including
# this list of one million 2-tuples of NumPy arrays.
>>> from beartype.door import is_bearable
>>> from numpy import array, ndarray
>>> data = [(array(i), array(i)) for i in range(1000000)]
>>> %time is_bearable(data, list[tuple[ndarray, ndarray]])
CPU times: user 31 µs, sys: 2 µs, total: 33 µs
Wall time: 36.7 µs
True
Beartype brings Rust_- and `C++`_-inspired `zero-cost abstractions <zero-cost
abstraction_>`__ into the lawless world of `dynamically-typed`_ Python by
`enforcing type safety at the granular level of functions and methods <beartype
ELI5_>`__ against `type hints standardized by the Python community <beartype
PEPs_>`__ in `O(1) non-amortized worst-case time with negligible constant
factors <beartype math_>`__. If the prior sentence was unreadable jargon, `see
our friendly and approachable FAQ for a human-readable synopsis <beartype
FAQ_>`__.
Beartype is `portably implemented <beartype codebase_>`__ in `Python 3
<Python_>`__, `continuously stress-tested <beartype tests_>`__ via `GitHub
Actions`_ **×** tox_ **×** pytest_ **×** Codecov_, and `permissively
distributed <beartype license_>`__ under the `MIT license`_. Beartype has *no*
runtime dependencies, `only one test-time dependency <pytest_>`__, and `only
one documentation-time dependency <Sphinx_>`__. Beartype supports `all actively
developed Python versions <Python status_>`__, `all Python package managers
<beartype install_>`__, and `multiple platform-specific package managers
<beartype install_>`__.
.. # FIXME: Gah! Libraries.io has fallen down and cannot get back up... *AGAIN.*
.. # Beartype `powers quality assurance across the Python ecosystem <beartype
.. # dependents_>`__.
.. # FIXME: Remove *ALL* of the following URLs except those specifically
.. # required above -- which should be most of them, frankly.
.. # ------------------( IMAGES )------------------
.. |beartype-banner| image:: https://raw.githubusercontent.com/beartype/beartype-assets/main/banner/logo.png
:target: https://beartype.readthedocs.io
:alt: beartype —[ the bare-metal type checker ]—
.. |beartype-contributors| image:: https://contrib.rocks/image?repo=beartype/beartype
:target: https://github.com/beartype/beartype/graphs/contributors
:alt: Beartype contributors
.. |beartype-stars| image:: https://star-history.com/#beartype/beartype&Date
:target: https://github.com/beartype/beartype/stargazers
:alt: Beartype stargazers
.. # ------------------( IMAGES ~ badge )------------------
.. |bear-ified| image:: https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg
:align: top
:target: https://beartype.readthedocs.io
:alt: bear-ified
.. |ci-badge| image:: https://github.com/beartype/beartype/workflows/test/badge.svg
:target: https://github.com/beartype/beartype/actions?workflow=test
:alt: beartype continuous integration (CI) status
.. |codecov-badge| image:: https://codecov.io/gh/beartype/beartype/branch/main/graph/badge.svg?token=E6F4YSY9ZQ
:target: https://codecov.io/gh/beartype/beartype
:alt: beartype test coverage status
.. |rtd-badge| image:: https://readthedocs.org/projects/beartype/badge/?version=latest
:target: https://beartype.readthedocs.io/en/latest/?badge=latest
:alt: beartype Read The Docs (RTD) status
.. # ------------------( IMAGES ~ downstream )------------------
.. # Insert links to GitHub Sponsors funding at the icon level here, please!
.. # ------------------( LINKS ~ beartype : funding )------------------
.. _BETSE:
https://github.com/betsee/betse
.. _BETSEE:
https://github.com/betsee/betsee
.. _GitHub Sponsors:
https://github.com/sponsors/leycec
.. _Paul Allen:
https://en.wikipedia.org/wiki/Paul_Allen
.. _Paul Allen Discovery Center:
http://www.alleninstitute.org/what-we-do/frontiers-group/discovery-centers/allen-discovery-center-tufts-university
.. _Paul Allen Discovery Center award:
https://www.alleninstitute.org/what-we-do/frontiers-group/news-press/press-resources/press-releases/paul-g-allen-frontiers-group-announces-allen-discovery-center-tufts-university
.. _Paul G. Allen Frontiers Group:
https://www.alleninstitute.org/what-we-do/frontiers-group
.. _Tufts University:
https://www.tufts.edu
.. _beartype sponsorship:
https://github.com/sponsors/leycec
.. # ------------------( LINKS ~ beartype : local )------------------
.. _beartype license:
LICENSE
.. # ------------------( LINKS ~ beartype : local : module )------------------
.. _beartype errormain:
beartype/_decor/_code/_pep/_error/errormain.py
.. _beartype pephint:
beartype/_decor/_code/_pep/_pephint.py
.. _beartype test data pep:
beartype_test/unit/data/hint/pep/proposal/
.. _beartype test data pep 484:
beartype_test/unit/data/hint/pep/proposal/data_hintpep484.py
.. _@callable_cached:
beartype/_util/cache/utilcachecall.py
.. _beartype util data pep:
beartype/_util/hint/data/pep/proposal/
.. _beartype util data pep parent:
beartype/_util/hint/data/pep/utilhintdatapep.py
.. _beartype util pep:
beartype/_util/hint/pep/proposal
.. # ------------------( LINKS ~ beartype : package )------------------
.. _beartype Anaconda:
https://anaconda.org/conda-forge/beartype
.. _beartype Gentoo:
https://github.com/leycec/raiagent
.. _beartype Homebrew:
https://github.com/beartype/homebrew-beartype
.. _beartype MacPorts:
https://ports.macports.org/port/py-beartype
.. _beartype PyPI:
https://pypi.org/project/beartype
.. # ------------------( LINKS ~ beartype : package : meta )------------------
.. _Libraries.io:
https://libraries.io
.. _beartype dependents:
https://libraries.io/pypi/beartype/dependents
.. # ------------------( LINKS ~ beartype : github )------------------
.. _beartype:
https://github.com/beartype/beartype
.. _beartype issues:
https://github.com/beartype/beartype/issues
.. _beartype 1.0.0:
https://github.com/beartype/beartype/issues/7
.. _beartype codebase:
https://github.com/beartype/beartype/tree/main/beartype
.. _beartype organization:
https://github.com/beartype
.. _beartype profiler:
https://github.com/beartype/beartype/blob/main/bin/profile.bash
.. _beartype pulls:
https://github.com/beartype/beartype/pulls
.. _beartype tests:
https://github.com/beartype/beartype/actions?workflow=tests
.. # ------------------( LINKS ~ beartype : github : user )------------------
.. _patrick-kidger:
https://github.com/patrick-kidger
.. _harens:
https://github.com/harens
.. _leycec:
https://github.com/leycec
.. # ------------------( LINKS ~ beartype : rtd )------------------
.. _beartype APIs:
https://beartype.readthedocs.io/en/latest/api
.. _beartype RTD:
https://beartype.readthedocs.io
.. _beartype ELI5:
https://beartype.readthedocs.io/en/latest/eli5
.. _beartype FAQ:
https://beartype.readthedocs.io/en/latest/faq
.. _beartype PEPs:
https://beartype.readthedocs.io/en/latest/pep
.. _beartype hybrid:
https://beartype.readthedocs.io/en/latest/faq/#faq-hybrid
.. _beartype install:
https://beartype.readthedocs.io/en/latest/install
.. _beartype math:
https://beartype.readthedocs.io/en/latest/math
.. _beartype pure:
https://beartype.readthedocs.io/en/latest/faq/#faq-pure
.. _beartype third:
https://beartype.readthedocs.io/en/latest/faq/#faq-third
.. # ------------------( LINKS ~ github )------------------
.. _GitHub Actions:
https://github.com/features/actions
.. _GitHub account signin:
https://github.com/login
.. _GitHub account signup:
https://github.com/join
.. _gitter:
https://gitter.im
.. # ------------------( LINKS ~ idea )------------------
.. _Denial-of-Service:
https://en.wikipedia.org/wiki/Denial-of-service_attack
.. _DRY:
https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
.. _IDE:
https://en.wikipedia.org/wiki/Integrated_development_environment
.. _JIT:
https://en.wikipedia.org/wiki/Just-in-time_compilation
.. _SQA:
https://en.wikipedia.org/wiki/Software_quality_assurance
.. _amortized analysis:
https://en.wikipedia.org/wiki/Amortized_analysis
.. _computer vision:
https://en.wikipedia.org/wiki/Computer_vision
.. _continuous integration:
https://en.wikipedia.org/wiki/Continuous_integration
.. _duck typing:
https://en.wikipedia.org/wiki/Duck_typing
.. _gratis versus libre:
https://en.wikipedia.org/wiki/Gratis_versus_libre
.. _memory safety:
https://en.wikipedia.org/wiki/Memory_safety
.. _multiple dispatch:
https://en.wikipedia.org/wiki/Multiple_dispatch
.. _near-real-time:
https://en.wikipedia.org/wiki/Real-time_computing#Near_real-time
.. _random walk:
https://en.wikipedia.org/wiki/Random_walk
.. _real-time:
https://en.wikipedia.org/wiki/Real-time_computing
.. _set theory:
https://en.wikipedia.org/wiki/Set_theory
.. _shield wall:
https://en.wikipedia.org/wiki/Shield_wall
.. _dynamic typing:
.. _dynamically-typed:
.. _static typing:
.. _statically-typed:
https://en.wikipedia.org/wiki/Type_system
.. _topological sort:
https://en.wikipedia.org/wiki/Topological_sorting
.. _type inference:
https://en.wikipedia.org/wiki/Type_inference
.. _zero-cost abstraction:
https://boats.gitlab.io/blog/post/zero-cost-abstractions
.. # ------------------( LINKS ~ kipling )------------------
.. _The Jungle Book:
https://www.gutenberg.org/files/236/236-h/236-h.htm
.. _Shere Khan:
https://en.wikipedia.org/wiki/Shere_Khan
.. # ------------------( LINKS ~ math )------------------
.. _Euler–Mascheroni constant:
https://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant
.. _coupon collector's problem:
https://en.wikipedia.org/wiki/Coupon_collector%27s_problem
.. _Big O:
https://en.wikipedia.org/wiki/Big_O_notation
.. # ------------------( LINKS ~ math : set )------------------
.. _conjunction:
https://en.wikipedia.org/wiki/Logical_conjunction
.. _disjunction:
https://en.wikipedia.org/wiki/Logical_disjunction
.. _intersection:
https://en.wikipedia.org/wiki/Intersection_(set_theory)
.. _relative set complement:
https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement
.. # ------------------( LINKS ~ math : type )------------------
.. _covariance:
https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
.. # ------------------( LINKS ~ meme )------------------
.. _RNGesus:
https://knowyourmeme.com/memes/rngesus
.. _goes up to eleven:
https://www.youtube.com/watch?v=uMSV4OteqBE
.. _greased lightning:
https://www.youtube.com/watch?v=H-kL8A4RNQ8
.. _ludicrous speed:
https://www.youtube.com/watch?v=6tTvklMXeFE
.. _the gripping hand:
http://catb.org/jargon/html/O/on-the-gripping-hand.html
.. # ------------------( LINKS ~ os : linux )------------------
.. _Gentoo:
https://www.gentoo.org
.. # ------------------( LINKS ~ os : macos )------------------
.. _macOS:
https://en.wikipedia.org/wiki/MacOS
.. _HomeBrew:
https://brew.sh
.. _MacPorts:
https://www.macports.org
.. # ------------------( LINKS ~ other )------------------
.. _heliotrope:
https://en.wikipedia.org/wiki/Heliotropium
.. # ------------------( LINKS ~ py )------------------
.. _Python:
https://www.python.org
.. _Python status:
https://devguide.python.org/#status-of-python-branches
.. _pip:
https://pip.pypa.io
.. # ------------------( LINKS ~ py : cli )------------------
.. _-O:
https://docs.python.org/3/using/cmdline.html#cmdoption-o
.. _PYTHONOPTIMIZE:
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE
.. # ------------------( LINKS ~ py : interpreter )------------------
.. _Brython:
https://brython.info
.. _CPython:
https://github.com/python/cpython
.. _Nuitka:
https://nuitka.net
.. _Numba:
https://numba.pydata.org
.. _PyPy:
https://www.pypy.org
.. # ------------------( LINKS ~ py : interpreter : cpython )------------------
.. _CPython bug tracker:
https://github.com/python/cpython/issues
.. # ------------------( LINKS ~ py : lang )------------------
.. _generic alias parameters:
https://docs.python.org/3/library/stdtypes.html#genericalias.__parameters__
.. _isinstancecheck:
https://docs.python.org/3/reference/datamodel.html#customizing-instance-and-subclass-checks
.. _mro:
https://docs.python.org/3/library/stdtypes.html#class.__mro__
.. _object:
https://docs.python.org/3/reference/datamodel.html#basic-customization
.. _operator precedence:
https://docs.python.org/3/reference/expressions.html#operator-precedence
.. # ------------------( LINKS ~ py : misc )------------------
.. _Guido van Rossum:
https://en.wikipedia.org/wiki/Guido_van_Rossum
.. _RealPython:
https://realpython.com/python-type-checking
.. # ------------------( LINKS ~ py : package )------------------
.. _Django:
https://www.djangoproject.com
.. _NetworkX:
https://networkx.org
.. _Pandas:
https://pandas.pydata.org
.. _PyTorch:
https://pytorch.org
.. _SymPy:
https://www.sympy.org
.. _numerary:
https://github.com/posita/numerary
.. _pyenv:
https://operatingops.org/2020/10/24/tox-testing-multiple-python-versions-with-pyenv
.. _typing_extensions:
https://pypi.org/project/typing-extensions
.. # ------------------( LINKS ~ py : package : boto3 )------------------
.. _Boto3:
https://aws.amazon.com/sdk-for-python
.. _bearboto3:
https://github.com/beartype/bearboto3
.. _mypy-boto3:
https://mypy-boto3.readthedocs.io
.. # ------------------( LINKS ~ py : package : jax )------------------
.. _jax.numpy:
https://jax.readthedocs.io/en/latest/notebooks/thinking_in_jax.html
.. # ------------------( LINKS ~ py : package : numpy )------------------
.. _NumPy:
https://numpy.org
.. _numpy.dtype:
https://numpy.org/doc/stable/reference/arrays.dtypes.html
.. _numpy.empty_like:
https://numpy.org/doc/stable/reference/generated/numpy.empty_like.html
.. _numpy.floating:
https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=numpy%20generic#numpy.floating
.. _numpy.generic:
https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=numpy%20generic#numpy.generic
.. _numpy.integer:
https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=numpy%20generic#numpy.integer
.. _numpy.typing:
https://numpy.org/devdocs/reference/typing.html
.. _numpy.typing.NDArray:
https://numpy.org/devdocs/reference/typing.html#ndarray
.. # ------------------( LINKS ~ py : package : sphinx )------------------
.. _Sphinx:
https://www.sphinx-doc.org
.. _sphinx.ext.autodoc:
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
.. # ------------------( LINKS ~ py : package : test )------------------
.. _Codecov:
https://about.codecov.io
.. _pytest:
https://docs.pytest.org
.. _tox:
https://tox.readthedocs.io
.. # ------------------( LINKS ~ py : service )------------------
.. _Anaconda:
https://docs.conda.io/en/latest/miniconda.html
.. _PyPI:
https://pypi.org
.. # ------------------( LINKS ~ py : type : runtime )------------------
.. _enforce:
https://github.com/RussBaz/enforce
.. _enforce_typing:
https://github.com/matchawine/python-enforce-typing
.. _pydantic:
https://pydantic-docs.helpmanual.io
.. _pytypes:
https://github.com/Stewori/pytypes
.. _typeen:
https://github.com/k2bd/typen
.. _typical:
https://github.com/seandstewart/typical
.. # ------------------( LINKS ~ py : type : runtime : typeg )------------------
.. _typeguard:
https://github.com/agronholm/typeguard
.. _typeguard.check_type:
https://typeguard.readthedocs.io/en/latest/userguide.html#checking-types-directly
.. # ------------------( LINKS ~ py : type : runtime : data )------------------
.. _PyContracts:
https://github.com/AlexandruBurlacu/pycontracts
.. _contracts:
https://pypi.org/project/contracts
.. _covenant:
https://github.com/kisielk/covenant
.. _dpcontracts:
https://pypi.org/project/dpcontracts
.. _icontract:
https://github.com/Parquery/icontract
.. _pyadbc:
https://pypi.org/project/pyadbc
.. _pcd:
https://pypi.org/project/pcd
.. # ------------------( LINKS ~ py : type : static )------------------
.. _Pyre:
https://pyre-check.org
.. _pytype:
https://github.com/google/pytype
.. # ------------------( LINKS ~ py : type : static : pyright)------------------
.. _pyright:
https://github.com/Microsoft/pyright
.. _pyright plugins:
https://github.com/microsoft/pyright/issues/607#issuecomment-873467941
.. _pyright PEP violation #1:
https://github.com/beartype/beartype/issues/126
.. _pyright PEP violation #2:
https://github.com/beartype/beartype/issues/127
.. # ------------------( LINKS ~ py : type : static : mypy )------------------
.. _mypy:
http://mypy-lang.org
.. _mypy install:
https://mypy.readthedocs.io/en/stable/getting_started.html
.. _mypy plugin:
https://mypy.readthedocs.io/en/stable/extending_mypy.html
.. _type narrowing:
https://mypy.readthedocs.io/en/stable/type_narrowing.html
.. # ------------------( LINKS ~ py : type : tensor )------------------
.. _jaxtyping:
https://github.com/google/jaxtyping
.. _nptyping:
https://github.com/ramonhagenaars/nptyping
.. _TorchTyping:
https://github.com/patrick-kidger/torchtyping
.. # ------------------( LINKS ~ soft : ide )------------------
.. _PyCharm:
https://en.wikipedia.org/wiki/PyCharm
.. _Vim:
https://www.vim.org
.. # ------------------( LINKS ~ soft : ide : vscode )------------------
.. _Pylance:
https://github.com/microsoft/pylance-release
.. _VSCode:
https://code.visualstudio.com
.. _VSCode Mypy extension:
https://marketplace.visualstudio.com/items?itemName=matangover.mypy
.. # ------------------( LINKS ~ soft : lang )------------------
.. _C:
https://en.wikipedia.org/wiki/C_(programming_language)
.. _C++:
https://en.wikipedia.org/wiki/C%2B%2B
.. _Ruby:
https://www.ruby-lang.org
.. _Rust:
https://www.rust-lang.org
.. # ------------------( LINKS ~ soft : license )------------------
.. _MIT license:
https://opensource.org/licenses/MIT
.. # ------------------( LINKS ~ soft : web )------------------
.. _React:
https://reactjs.org
Raw data
{
"_id": null,
"home_page": null,
"name": "beartype",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "annotations, python, type checking, type hints",
"author": null,
"author_email": "Cecil Curry <leycec@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6f/e1/00515b97afa3993b4a314e4bc168fbde0917fd5845435cb6f16a19770746/beartype-0.19.0.tar.gz",
"platform": null,
"description": ".. # ------------------( LICENSE )------------------\n.. # Copyright (c) 2014-2024 Beartype authors.\n.. # See \"LICENSE\" for further details.\n.. #\n.. # ------------------( SEO )------------------\n.. # Metadata converted into HTML-specific meta tags parsed by search engines.\n.. # Note that:\n.. # * The \"description\" should be no more than 300 characters and ideally no\n.. # more than 150 characters, as search engines may silently truncate this\n.. # description to 150 characters in edge cases.\n\n.. meta::\n :description lang=en:\n Beartype is an open-source pure-Python PEP-compliant constant-time runtime\n type checker emphasizing efficiency and portability.\n\n.. # ------------------( SYNOPSIS )------------------\n\n=================\n|beartype-banner|\n=================\n\n|rtd-badge| |ci-badge| |codecov-badge|\n\n \u26a0\n\n `Beartype documentation lives at ReadTheDocs (RTD) <beartype RTD_>`__. It's\n readable, structured, and soothing to the deep folds of your big galactic\n brain. Open your mind to an ocean of mundane knowledge that will exhaust\n you at work. Enter... **the Bearpedia:**\n\n https://beartype.readthedocs.io\n\n The document you are now reading was once a monolithic ~316Kb file known to\n induce migraines in 22% of the whole devops population. For your safety,\n that document no longer exists. This is how much beartype cares.\n\n**Beartype** is an `open-source <beartype license_>`__ `pure-Python <beartype\npure_>`__ `PEP-compliant <beartype PEPs_>`__ `near-real-time <beartype FAQ_>`__\n`hybrid runtime-static <beartype hybrid_>`__ `third-generation <beartype\nthird_>`__ `type checker <beartype ELI5_>`__ emphasizing efficiency,\nusability, unsubstantiated jargon we just made up, and thrilling puns.\n\n.. #FIXME: Once we actually receive a sponsor at this tier, please remove this\n.. #placeholder as well as the icon links below. kthx\n.. #The `Bear Team <beartype organization_>`__ gratefully thanks `our family of\n.. #breathtaking GitHub Sponsors <beartype sponsorship_>`__:\n.. #\n.. #* **Your iconic URL here.** `Let us bestow you with eyeballs <beartype\n.. # sponsorship_>`__.\n.. #FIXME: Once we actually receive a sponsor at this tier, please remove this\n.. #placeholder as well as the icon links below. kthx\n.. # |icon-for-glorious-sponsor|\n\n.. code-block:: bash\n\n # Install beartype.\n $ pip3 install beartype\n # Edit the \"{your_package}.__init__\" submodule with your favourite IDE.\n $ vim {your_package}/__init__.py # <-- so, i see that you too vim\n\n.. code-block:: python\n\n from beartype.claw import beartype_this_package # <-- hype comes\n beartype_this_package() # <-- hype goes\n\nBeartype now implicitly type-checks *all* annotated classes, callables, and\nvariable assignments across *all* submodules of your package. Congrats. This day\nall bugs die.\n\nBut why stop at the burning tires in only *your* code? Your app depends on a\nsprawling ghetto of other packages, modules, and services. How riddled with\ninfectious diseases is *that* code? You're about to find out.\n\n.. code-block:: python\n\n # ....................{ BIG BEAR }....................\n # Warn about type hint violations in *OTHER* packages outside your control;\n # only raise exceptions from violations in your package under your control.\n # Again, at the very top of your \"{your_package}.__init__\" submodule:\n from beartype import BeartypeConf # <-- this isn't your fault\n from beartype.claw import beartype_all, beartype_this_package # <-- you didn't sign up for this\n beartype_this_package() # <-- raise exceptions in your code\n beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from other code\n\nBeartype now implicitly type-checks *all* annotated classes, callables, and\nvariable assignments across *all* submodules of *all* packages. When **your**\npackage violates type safety, beartype raises an exception. When any **other**\npackage violates type safety, beartype just emits a warning. The triumphal\nfanfare you hear is probably your userbase cheering. This is how the QA was won.\n\nBeartype also publishes a `plethora of APIs for fine-grained control over\ntype-checking <beartype APIs>`. For those who are about to QA, beartype salutes\nyou. Would you like to know more?\n\n # So let's do this.\n $ python3\n\n.. code-block:: python\n\n # ....................{ RAISE THE PAW }....................\n # Manually enforce type hints across individual classes and callables.\n # Do this only if you want a(nother) repetitive stress injury.\n\n # Import the @beartype decorator.\n >>> from beartype import beartype # <-- eponymous import; it's eponymous\n\n # Annotate @beartype-decorated classes and callables with type hints.\n >>> @beartype # <-- you too will believe in magic\n ... def quote_wiggum(lines: list[str]) -> None:\n ... print('\u201c{}\u201d\\n\\t\u2014 Police Chief Wiggum'.format(\"\\n \".join(lines)))\n\n # Call those callables with valid parameters.\n >>> quote_wiggum([\"Okay, folks. Show's over!\", \" Nothing to see here. Show's\u2026\",])\n \u201cOkay, folks. Show's over!\n Nothing to see here. Show's\u2026\u201d\n \u2014 Police Chief Wiggum\n\n # Call those callables with invalid parameters.\n >>> quote_wiggum([b\"Oh, my God! A horrible plane crash!\", b\"Hey, everybody! Get a load of this flaming wreckage!\",])\n Traceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"<string>\", line 30, in quote_wiggum\n File \"/home/springfield/beartype/lib/python3.9/site-packages/beartype/_decor/_code/_pep/_error/errormain.py\", line 220, in get_beartype_violation\n raise exception_cls(\n beartype.roar.BeartypeCallHintParamViolation: @beartyped\n quote_wiggum() parameter lines=[b'Oh, my God! A horrible plane\n crash!', b'Hey, everybody! Get a load of thi...'] violates type hint\n list[str], as list item 0 value b'Oh, my God! A horrible plane crash!'\n not str.\n\n # ....................{ MAKE IT SO }....................\n # Squash bugs by refining type hints with @beartype validators.\n >>> from beartype.vale import Is # <---- validator factory\n >>> from typing import Annotated # <---------------- if Python \u2265 3.9.0\n # >>> from typing_extensions import Annotated # <-- if Python < 3.9.0\n\n # Validators are type hints constrained by lambda functions.\n >>> ListOfStrings = Annotated[ # <----- type hint matching non-empty list of strings\n ... list[str], # <----------------- type hint matching possibly empty list of strings\n ... Is[lambda lst: bool(lst)] # <-- lambda matching non-empty object\n ... ]\n\n # Annotate @beartype-decorated callables with validators.\n >>> @beartype\n ... def quote_wiggum_safer(lines: ListOfStrings) -> None:\n ... print('\u201c{}\u201d\\n\\t\u2014 Police Chief Wiggum'.format(\"\\n \".join(lines)))\n\n # Call those callables with invalid parameters.\n >>> quote_wiggum_safer([])\n beartype.roar.BeartypeCallHintParamViolation: @beartyped\n quote_wiggum_safer() parameter lines=[] violates type hint\n typing.Annotated[list[str], Is[lambda lst: bool(lst)]], as value []\n violates validator Is[lambda lst: bool(lst)].\n\n # ....................{ AT ANY TIME }....................\n # Type-check anything against any type hint \u2013 anywhere at anytime.\n >>> from beartype.door import (\n ... is_bearable, # <-------- like \"isinstance(...)\"\n ... die_if_unbearable, # <-- like \"assert isinstance(...)\"\n ... )\n >>> is_bearable(['The', 'goggles', 'do', 'nothing.'], list[str])\n True\n >>> die_if_unbearable([0xCAFEBEEF, 0x8BADF00D], ListOfStrings)\n beartype.roar.BeartypeDoorHintViolation: Object [3405692655, 2343432205]\n violates type hint typing.Annotated[list[str], Is[lambda lst: bool(lst)]],\n as list index 0 item 3405692655 not instance of str.\n\n # ....................{ GO TO PLAID }....................\n # Type-check anything in around 1\u00b5s (one millionth of a second) \u2013 including\n # this list of one million 2-tuples of NumPy arrays.\n >>> from beartype.door import is_bearable\n >>> from numpy import array, ndarray\n >>> data = [(array(i), array(i)) for i in range(1000000)]\n >>> %time is_bearable(data, list[tuple[ndarray, ndarray]])\n CPU times: user 31 \u00b5s, sys: 2 \u00b5s, total: 33 \u00b5s\n Wall time: 36.7 \u00b5s\n True\n\nBeartype brings Rust_- and `C++`_-inspired `zero-cost abstractions <zero-cost\nabstraction_>`__ into the lawless world of `dynamically-typed`_ Python by\n`enforcing type safety at the granular level of functions and methods <beartype\nELI5_>`__ against `type hints standardized by the Python community <beartype\nPEPs_>`__ in `O(1) non-amortized worst-case time with negligible constant\nfactors <beartype math_>`__. If the prior sentence was unreadable jargon, `see\nour friendly and approachable FAQ for a human-readable synopsis <beartype\nFAQ_>`__.\n\nBeartype is `portably implemented <beartype codebase_>`__ in `Python 3\n<Python_>`__, `continuously stress-tested <beartype tests_>`__ via `GitHub\nActions`_ **\u00d7** tox_ **\u00d7** pytest_ **\u00d7** Codecov_, and `permissively\ndistributed <beartype license_>`__ under the `MIT license`_. Beartype has *no*\nruntime dependencies, `only one test-time dependency <pytest_>`__, and `only\none documentation-time dependency <Sphinx_>`__. Beartype supports `all actively\ndeveloped Python versions <Python status_>`__, `all Python package managers\n<beartype install_>`__, and `multiple platform-specific package managers\n<beartype install_>`__.\n\n.. # FIXME: Gah! Libraries.io has fallen down and cannot get back up... *AGAIN.*\n.. # Beartype `powers quality assurance across the Python ecosystem <beartype\n.. # dependents_>`__.\n\n.. # FIXME: Remove *ALL* of the following URLs except those specifically\n.. # required above -- which should be most of them, frankly.\n\n.. # ------------------( IMAGES )------------------\n.. |beartype-banner| image:: https://raw.githubusercontent.com/beartype/beartype-assets/main/banner/logo.png\n :target: https://beartype.readthedocs.io\n :alt: beartype \u2014[ the bare-metal type checker ]\u2014\n.. |beartype-contributors| image:: https://contrib.rocks/image?repo=beartype/beartype\n :target: https://github.com/beartype/beartype/graphs/contributors\n :alt: Beartype contributors\n.. |beartype-stars| image:: https://star-history.com/#beartype/beartype&Date\n :target: https://github.com/beartype/beartype/stargazers\n :alt: Beartype stargazers\n\n.. # ------------------( IMAGES ~ badge )------------------\n.. |bear-ified| image:: https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg\n :align: top\n :target: https://beartype.readthedocs.io\n :alt: bear-ified\n.. |ci-badge| image:: https://github.com/beartype/beartype/workflows/test/badge.svg\n :target: https://github.com/beartype/beartype/actions?workflow=test\n :alt: beartype continuous integration (CI) status\n.. |codecov-badge| image:: https://codecov.io/gh/beartype/beartype/branch/main/graph/badge.svg?token=E6F4YSY9ZQ\n :target: https://codecov.io/gh/beartype/beartype\n :alt: beartype test coverage status\n.. |rtd-badge| image:: https://readthedocs.org/projects/beartype/badge/?version=latest\n :target: https://beartype.readthedocs.io/en/latest/?badge=latest\n :alt: beartype Read The Docs (RTD) status\n\n.. # ------------------( IMAGES ~ downstream )------------------\n.. # Insert links to GitHub Sponsors funding at the icon level here, please!\n\n.. # ------------------( LINKS ~ beartype : funding )------------------\n.. _BETSE:\n https://github.com/betsee/betse\n.. _BETSEE:\n https://github.com/betsee/betsee\n.. _GitHub Sponsors:\n https://github.com/sponsors/leycec\n.. _Paul Allen:\n https://en.wikipedia.org/wiki/Paul_Allen\n.. _Paul Allen Discovery Center:\n http://www.alleninstitute.org/what-we-do/frontiers-group/discovery-centers/allen-discovery-center-tufts-university\n.. _Paul Allen Discovery Center award:\n https://www.alleninstitute.org/what-we-do/frontiers-group/news-press/press-resources/press-releases/paul-g-allen-frontiers-group-announces-allen-discovery-center-tufts-university\n.. _Paul G. Allen Frontiers Group:\n https://www.alleninstitute.org/what-we-do/frontiers-group\n.. _Tufts University:\n https://www.tufts.edu\n.. _beartype sponsorship:\n https://github.com/sponsors/leycec\n\n.. # ------------------( LINKS ~ beartype : local )------------------\n.. _beartype license:\n LICENSE\n\n.. # ------------------( LINKS ~ beartype : local : module )------------------\n.. _beartype errormain:\n beartype/_decor/_code/_pep/_error/errormain.py\n.. _beartype pephint:\n beartype/_decor/_code/_pep/_pephint.py\n.. _beartype test data pep:\n beartype_test/unit/data/hint/pep/proposal/\n.. _beartype test data pep 484:\n beartype_test/unit/data/hint/pep/proposal/data_hintpep484.py\n.. _@callable_cached:\n beartype/_util/cache/utilcachecall.py\n.. _beartype util data pep:\n beartype/_util/hint/data/pep/proposal/\n.. _beartype util data pep parent:\n beartype/_util/hint/data/pep/utilhintdatapep.py\n.. _beartype util pep:\n beartype/_util/hint/pep/proposal\n\n.. # ------------------( LINKS ~ beartype : package )------------------\n.. _beartype Anaconda:\n https://anaconda.org/conda-forge/beartype\n.. _beartype Gentoo:\n https://github.com/leycec/raiagent\n.. _beartype Homebrew:\n https://github.com/beartype/homebrew-beartype\n.. _beartype MacPorts:\n https://ports.macports.org/port/py-beartype\n.. _beartype PyPI:\n https://pypi.org/project/beartype\n\n.. # ------------------( LINKS ~ beartype : package : meta )------------------\n.. _Libraries.io:\n https://libraries.io\n.. _beartype dependents:\n https://libraries.io/pypi/beartype/dependents\n\n.. # ------------------( LINKS ~ beartype : github )------------------\n.. _beartype:\n https://github.com/beartype/beartype\n.. _beartype issues:\n https://github.com/beartype/beartype/issues\n.. _beartype 1.0.0:\n https://github.com/beartype/beartype/issues/7\n.. _beartype codebase:\n https://github.com/beartype/beartype/tree/main/beartype\n.. _beartype organization:\n https://github.com/beartype\n.. _beartype profiler:\n https://github.com/beartype/beartype/blob/main/bin/profile.bash\n.. _beartype pulls:\n https://github.com/beartype/beartype/pulls\n.. _beartype tests:\n https://github.com/beartype/beartype/actions?workflow=tests\n\n.. # ------------------( LINKS ~ beartype : github : user )------------------\n.. _patrick-kidger:\n https://github.com/patrick-kidger\n.. _harens:\n https://github.com/harens\n.. _leycec:\n https://github.com/leycec\n\n.. # ------------------( LINKS ~ beartype : rtd )------------------\n.. _beartype APIs:\n https://beartype.readthedocs.io/en/latest/api\n.. _beartype RTD:\n https://beartype.readthedocs.io\n.. _beartype ELI5:\n https://beartype.readthedocs.io/en/latest/eli5\n.. _beartype FAQ:\n https://beartype.readthedocs.io/en/latest/faq\n.. _beartype PEPs:\n https://beartype.readthedocs.io/en/latest/pep\n.. _beartype hybrid:\n https://beartype.readthedocs.io/en/latest/faq/#faq-hybrid\n.. _beartype install:\n https://beartype.readthedocs.io/en/latest/install\n.. _beartype math:\n https://beartype.readthedocs.io/en/latest/math\n.. _beartype pure:\n https://beartype.readthedocs.io/en/latest/faq/#faq-pure\n.. _beartype third:\n https://beartype.readthedocs.io/en/latest/faq/#faq-third\n\n.. # ------------------( LINKS ~ github )------------------\n.. _GitHub Actions:\n https://github.com/features/actions\n.. _GitHub account signin:\n https://github.com/login\n.. _GitHub account signup:\n https://github.com/join\n.. _gitter:\n https://gitter.im\n\n.. # ------------------( LINKS ~ idea )------------------\n.. _Denial-of-Service:\n https://en.wikipedia.org/wiki/Denial-of-service_attack\n.. _DRY:\n https://en.wikipedia.org/wiki/Don%27t_repeat_yourself\n.. _IDE:\n https://en.wikipedia.org/wiki/Integrated_development_environment\n.. _JIT:\n https://en.wikipedia.org/wiki/Just-in-time_compilation\n.. _SQA:\n https://en.wikipedia.org/wiki/Software_quality_assurance\n.. _amortized analysis:\n https://en.wikipedia.org/wiki/Amortized_analysis\n.. _computer vision:\n https://en.wikipedia.org/wiki/Computer_vision\n.. _continuous integration:\n https://en.wikipedia.org/wiki/Continuous_integration\n.. _duck typing:\n https://en.wikipedia.org/wiki/Duck_typing\n.. _gratis versus libre:\n https://en.wikipedia.org/wiki/Gratis_versus_libre\n.. _memory safety:\n https://en.wikipedia.org/wiki/Memory_safety\n.. _multiple dispatch:\n https://en.wikipedia.org/wiki/Multiple_dispatch\n.. _near-real-time:\n https://en.wikipedia.org/wiki/Real-time_computing#Near_real-time\n.. _random walk:\n https://en.wikipedia.org/wiki/Random_walk\n.. _real-time:\n https://en.wikipedia.org/wiki/Real-time_computing\n.. _set theory:\n https://en.wikipedia.org/wiki/Set_theory\n.. _shield wall:\n https://en.wikipedia.org/wiki/Shield_wall\n.. _dynamic typing:\n.. _dynamically-typed:\n.. _static typing:\n.. _statically-typed:\n https://en.wikipedia.org/wiki/Type_system\n.. _topological sort:\n https://en.wikipedia.org/wiki/Topological_sorting\n.. _type inference:\n https://en.wikipedia.org/wiki/Type_inference\n.. _zero-cost abstraction:\n https://boats.gitlab.io/blog/post/zero-cost-abstractions\n\n.. # ------------------( LINKS ~ kipling )------------------\n.. _The Jungle Book:\n https://www.gutenberg.org/files/236/236-h/236-h.htm\n.. _Shere Khan:\n https://en.wikipedia.org/wiki/Shere_Khan\n\n.. # ------------------( LINKS ~ math )------------------\n.. _Euler\u2013Mascheroni constant:\n https://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant\n.. _coupon collector's problem:\n https://en.wikipedia.org/wiki/Coupon_collector%27s_problem\n.. _Big O:\n https://en.wikipedia.org/wiki/Big_O_notation\n\n.. # ------------------( LINKS ~ math : set )------------------\n.. _conjunction:\n https://en.wikipedia.org/wiki/Logical_conjunction\n.. _disjunction:\n https://en.wikipedia.org/wiki/Logical_disjunction\n.. _intersection:\n https://en.wikipedia.org/wiki/Intersection_(set_theory)\n.. _relative set complement:\n https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement\n\n.. # ------------------( LINKS ~ math : type )------------------\n.. _covariance:\n https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)\n\n.. # ------------------( LINKS ~ meme )------------------\n.. _RNGesus:\n https://knowyourmeme.com/memes/rngesus\n.. _goes up to eleven:\n https://www.youtube.com/watch?v=uMSV4OteqBE\n.. _greased lightning:\n https://www.youtube.com/watch?v=H-kL8A4RNQ8\n.. _ludicrous speed:\n https://www.youtube.com/watch?v=6tTvklMXeFE\n.. _the gripping hand:\n http://catb.org/jargon/html/O/on-the-gripping-hand.html\n\n.. # ------------------( LINKS ~ os : linux )------------------\n.. _Gentoo:\n https://www.gentoo.org\n\n.. # ------------------( LINKS ~ os : macos )------------------\n.. _macOS:\n https://en.wikipedia.org/wiki/MacOS\n.. _HomeBrew:\n https://brew.sh\n.. _MacPorts:\n https://www.macports.org\n\n.. # ------------------( LINKS ~ other )------------------\n.. _heliotrope:\n https://en.wikipedia.org/wiki/Heliotropium\n\n.. # ------------------( LINKS ~ py )------------------\n.. _Python:\n https://www.python.org\n.. _Python status:\n https://devguide.python.org/#status-of-python-branches\n.. _pip:\n https://pip.pypa.io\n\n.. # ------------------( LINKS ~ py : cli )------------------\n.. _-O:\n https://docs.python.org/3/using/cmdline.html#cmdoption-o\n.. _PYTHONOPTIMIZE:\n https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE\n\n.. # ------------------( LINKS ~ py : interpreter )------------------\n.. _Brython:\n https://brython.info\n.. _CPython:\n https://github.com/python/cpython\n.. _Nuitka:\n https://nuitka.net\n.. _Numba:\n https://numba.pydata.org\n.. _PyPy:\n https://www.pypy.org\n\n.. # ------------------( LINKS ~ py : interpreter : cpython )------------------\n.. _CPython bug tracker:\n https://github.com/python/cpython/issues\n\n.. # ------------------( LINKS ~ py : lang )------------------\n.. _generic alias parameters:\n https://docs.python.org/3/library/stdtypes.html#genericalias.__parameters__\n.. _isinstancecheck:\n https://docs.python.org/3/reference/datamodel.html#customizing-instance-and-subclass-checks\n.. _mro:\n https://docs.python.org/3/library/stdtypes.html#class.__mro__\n.. _object:\n https://docs.python.org/3/reference/datamodel.html#basic-customization\n.. _operator precedence:\n https://docs.python.org/3/reference/expressions.html#operator-precedence\n\n.. # ------------------( LINKS ~ py : misc )------------------\n.. _Guido van Rossum:\n https://en.wikipedia.org/wiki/Guido_van_Rossum\n.. _RealPython:\n https://realpython.com/python-type-checking\n\n.. # ------------------( LINKS ~ py : package )------------------\n.. _Django:\n https://www.djangoproject.com\n.. _NetworkX:\n https://networkx.org\n.. _Pandas:\n https://pandas.pydata.org\n.. _PyTorch:\n https://pytorch.org\n.. _SymPy:\n https://www.sympy.org\n.. _numerary:\n https://github.com/posita/numerary\n.. _pyenv:\n https://operatingops.org/2020/10/24/tox-testing-multiple-python-versions-with-pyenv\n.. _typing_extensions:\n https://pypi.org/project/typing-extensions\n\n.. # ------------------( LINKS ~ py : package : boto3 )------------------\n.. _Boto3:\n https://aws.amazon.com/sdk-for-python\n.. _bearboto3:\n https://github.com/beartype/bearboto3\n.. _mypy-boto3:\n https://mypy-boto3.readthedocs.io\n\n.. # ------------------( LINKS ~ py : package : jax )------------------\n.. _jax.numpy:\n https://jax.readthedocs.io/en/latest/notebooks/thinking_in_jax.html\n\n.. # ------------------( LINKS ~ py : package : numpy )------------------\n.. _NumPy:\n https://numpy.org\n.. _numpy.dtype:\n https://numpy.org/doc/stable/reference/arrays.dtypes.html\n.. _numpy.empty_like:\n https://numpy.org/doc/stable/reference/generated/numpy.empty_like.html\n.. _numpy.floating:\n https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=numpy%20generic#numpy.floating\n.. _numpy.generic:\n https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=numpy%20generic#numpy.generic\n.. _numpy.integer:\n https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=numpy%20generic#numpy.integer\n.. _numpy.typing:\n https://numpy.org/devdocs/reference/typing.html\n.. _numpy.typing.NDArray:\n https://numpy.org/devdocs/reference/typing.html#ndarray\n\n.. # ------------------( LINKS ~ py : package : sphinx )------------------\n.. _Sphinx:\n https://www.sphinx-doc.org\n.. _sphinx.ext.autodoc:\n https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html\n\n.. # ------------------( LINKS ~ py : package : test )------------------\n.. _Codecov:\n https://about.codecov.io\n.. _pytest:\n https://docs.pytest.org\n.. _tox:\n https://tox.readthedocs.io\n\n.. # ------------------( LINKS ~ py : service )------------------\n.. _Anaconda:\n https://docs.conda.io/en/latest/miniconda.html\n.. _PyPI:\n https://pypi.org\n\n.. # ------------------( LINKS ~ py : type : runtime )------------------\n.. _enforce:\n https://github.com/RussBaz/enforce\n.. _enforce_typing:\n https://github.com/matchawine/python-enforce-typing\n.. _pydantic:\n https://pydantic-docs.helpmanual.io\n.. _pytypes:\n https://github.com/Stewori/pytypes\n.. _typeen:\n https://github.com/k2bd/typen\n.. _typical:\n https://github.com/seandstewart/typical\n\n.. # ------------------( LINKS ~ py : type : runtime : typeg )------------------\n.. _typeguard:\n https://github.com/agronholm/typeguard\n.. _typeguard.check_type:\n https://typeguard.readthedocs.io/en/latest/userguide.html#checking-types-directly\n\n.. # ------------------( LINKS ~ py : type : runtime : data )------------------\n.. _PyContracts:\n https://github.com/AlexandruBurlacu/pycontracts\n.. _contracts:\n https://pypi.org/project/contracts\n.. _covenant:\n https://github.com/kisielk/covenant\n.. _dpcontracts:\n https://pypi.org/project/dpcontracts\n.. _icontract:\n https://github.com/Parquery/icontract\n.. _pyadbc:\n https://pypi.org/project/pyadbc\n.. _pcd:\n https://pypi.org/project/pcd\n\n.. # ------------------( LINKS ~ py : type : static )------------------\n.. _Pyre:\n https://pyre-check.org\n.. _pytype:\n https://github.com/google/pytype\n\n.. # ------------------( LINKS ~ py : type : static : pyright)------------------\n.. _pyright:\n https://github.com/Microsoft/pyright\n.. _pyright plugins:\n https://github.com/microsoft/pyright/issues/607#issuecomment-873467941\n.. _pyright PEP violation #1:\n https://github.com/beartype/beartype/issues/126\n.. _pyright PEP violation #2:\n https://github.com/beartype/beartype/issues/127\n\n.. # ------------------( LINKS ~ py : type : static : mypy )------------------\n.. _mypy:\n http://mypy-lang.org\n.. _mypy install:\n https://mypy.readthedocs.io/en/stable/getting_started.html\n.. _mypy plugin:\n https://mypy.readthedocs.io/en/stable/extending_mypy.html\n.. _type narrowing:\n https://mypy.readthedocs.io/en/stable/type_narrowing.html\n\n.. # ------------------( LINKS ~ py : type : tensor )------------------\n.. _jaxtyping:\n https://github.com/google/jaxtyping\n.. _nptyping:\n https://github.com/ramonhagenaars/nptyping\n.. _TorchTyping:\n https://github.com/patrick-kidger/torchtyping\n\n.. # ------------------( LINKS ~ soft : ide )------------------\n.. _PyCharm:\n https://en.wikipedia.org/wiki/PyCharm\n.. _Vim:\n https://www.vim.org\n\n.. # ------------------( LINKS ~ soft : ide : vscode )------------------\n.. _Pylance:\n https://github.com/microsoft/pylance-release\n.. _VSCode:\n https://code.visualstudio.com\n.. _VSCode Mypy extension:\n https://marketplace.visualstudio.com/items?itemName=matangover.mypy\n\n.. # ------------------( LINKS ~ soft : lang )------------------\n.. _C:\n https://en.wikipedia.org/wiki/C_(programming_language)\n.. _C++:\n https://en.wikipedia.org/wiki/C%2B%2B\n.. _Ruby:\n https://www.ruby-lang.org\n.. _Rust:\n https://www.rust-lang.org\n\n.. # ------------------( LINKS ~ soft : license )------------------\n.. _MIT license:\n https://opensource.org/licenses/MIT\n\n.. # ------------------( LINKS ~ soft : web )------------------\n.. _React:\n https://reactjs.org\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2014-2024 Beartype authors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Unbearably fast near-real-time hybrid runtime-static type-checking in pure Python.",
"version": "0.19.0",
"project_urls": {
"Docs": "https://beartype.readthedocs.io",
"Forums": "https://github.com/beartype/beartype/discussions",
"GitHub": "https://github.com/beartype/beartype",
"Issues": "https://github.com/beartype/beartype/issues",
"Releases": "https://github.com/beartype/beartype/releases"
},
"split_keywords": [
"annotations",
" python",
" type checking",
" type hints"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6469f6db6e4cb2fe2f887dead40b76caa91af4844cb647dd2c7223bb010aa416",
"md5": "3a9839cad96e3c4ac32a9126ccef8b57",
"sha256": "33b2694eda0daf052eb2aff623ed9a8a586703bbf0a90bbc475a83bbf427f699"
},
"downloads": -1,
"filename": "beartype-0.19.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3a9839cad96e3c4ac32a9126ccef8b57",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 1039760,
"upload_time": "2024-09-26T07:06:13",
"upload_time_iso_8601": "2024-09-26T07:06:13.546864Z",
"url": "https://files.pythonhosted.org/packages/64/69/f6db6e4cb2fe2f887dead40b76caa91af4844cb647dd2c7223bb010aa416/beartype-0.19.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6fe100515b97afa3993b4a314e4bc168fbde0917fd5845435cb6f16a19770746",
"md5": "4486fbf2375cb38b4f49c264ea887951",
"sha256": "de42dfc1ba5c3710fde6c3002e3bd2cad236ed4d2aabe876345ab0b4234a6573"
},
"downloads": -1,
"filename": "beartype-0.19.0.tar.gz",
"has_sig": false,
"md5_digest": "4486fbf2375cb38b4f49c264ea887951",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1294480,
"upload_time": "2024-09-26T07:06:17",
"upload_time_iso_8601": "2024-09-26T07:06:17.308334Z",
"url": "https://files.pythonhosted.org/packages/6f/e1/00515b97afa3993b4a314e4bc168fbde0917fd5845435cb6f16a19770746/beartype-0.19.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-26 07:06:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "beartype",
"github_project": "beartype",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "beartype"
}