python_code
stringlengths
0
108k
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype validator PEP-compliant type hints** (i.e., hints annotating callables declared throughout the :mod:`beartype.vale` sub...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype validator callable utilities** (i.e., callables performing low-level callable-centric operations on behalf of higher-le...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype validator code snippets** (i.e., triple-quoted pure-Python code constants formatted and concatenated together into wrap...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype validator text utilities** (i.e., callables performing low-level string-centric operations on behalf of higher-level be...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Core unary beartype validators** (i.e., :class:`BeartypeValidator` subclasses implementing binary operations on pairs of lower-l...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Core unary beartype validators** (i.e., :class:`BeartypeValidator` subclasses implementing unary operations on a single lower-le...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Core beartype validator.** This private submodule defines the core private :class:`BeartypeValidator` class instantiated by pub...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype declarative type validation classes** (i.e., :mod:`beartype`-specific classes enabling callers to define PEP-compliant ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype functional validation classes** (i.e., :mod:`beartype`-specific classes enabling callers to define PEP-compliant valida...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype declarative object validation classes** (i.e., :mod:`beartype`-specific classes enabling callers to define PEP-complian...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype declarative operator validation classes** (i.e., :mod:`beartype`-specific classes enabling callers to define PEP-compli...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype validation superclasses** (i.e., :mod:`beartype`-specific abstract base classes (ABCs) from all concrete beartype valid...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype Python Enhancement Proposal (PEP) API.** This subpackage provides a medley of miscellaneous low-level utility function...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`563` **support.** (i.e., low-level functions resolving stringified PEP-compliant type hints implicitly postpone...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype slow cave** (i.e., private subset of the public :mod:`beartype.cave` subpackage profiled to *not* be efficiently import...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype cave.** This submodule collects common types (e.g., :class:`NoneType`, the type of the ``None`` singleton) and tuples ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype fast cave** (i.e., private subset of the public :mod:`beartype.cave` subpackage profiled to be efficiently importable a...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype cave-specific abstract base classes (ABCs).** ''' # ....................{ TODO }...........
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype cave-specific abstract base classes (ABCs).** ''' # ....................{ TODO }...........
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Unmemoized beartype decorator.** This private submodule defines all core high-level logic underlying the :func:`beartype.bearty...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. # ....................{ TODO }.................... #FIXME: "typing.LiteralString". We just had a mildly ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Public beartype decorator.** This private submodule defines the core :func:`beartype` decorator, which the :mod:`beartype.__ini...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Memoized beartype decorator.** This private submodule defines the core :func:`beartype.beartype` decorator, conditionally impor...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartypistry** (i.e., singleton dictionary mapping from the fully-qualified classnames of all type hints annotating callables de...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype exception raisers** (i.e., high-level callables raising human-readable exceptions called by :func:`beartype.beartype`-d...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype type-checking error cause sleuth** (i.e., object recursively fabricating the human-readable string describing the failu...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype class type hint violation describers** (i.e., functions returning human-readable strings explaining violations of type ...
# --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype exception message color utilities** (i.e., low-level callables conditionally accenting type-checking violation messages with ANSI escape seque...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype error-handling string munging utilities** (i.e., functions returning substrings intended to be embedded in strings expl...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`586`-compliant **type hint violation describers** (i.e., functions returning human-readable strings explaining ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`593`-compliant **type hint violation describers** (i.e., functions returning human-readable strings explaining ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype PEP-compliant generic type hint exception raisers** (i.e., functions raising human-readable exceptions called by :mod:`...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`484`- and :pep:`585`-compliant **sequence type hint violation describers** (i.e., functions returning human-rea...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`484`-compliant :attr:`typing.NoReturn` **type hint violation describers** (i.e., functions returning human-read...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`484`-compliant **union type hint violation describers** (i.e., functions returning human-readable strings expla...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype type-checking wrapper function code factories** (i.e., low-level callables dynamically generating pure-Python code snip...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. # ....................{ TODO }.................... #FIXME: Major optimization: duplicate the signature of ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype decorator code generator.** This private submodule dynamically generates both the signature and body of the wrapper fu...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Beartype decorator **wrapper function code snippets** (i.e., triple-quoted pure-Python string constants formatted and concatenated...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype type-checking function code factories** (i.e., low-level callables dynamically generating pure-Python code snippets typ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Beartype decorator **type-checking function code magic** (i.e., global string constants embedded in the implementations of functio...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **type-checking function code snippets** (i.e., triple-quoted pure-Python string constants formatted and concatenated...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype dataclass** (i.e., class aggregating *all* metadata for the callable currently being decorated by the :func:`beartype.b...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **type-checking function utility code snippets** (i.e., triple-quoted pure-Python string constants formatted and conc...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype type-checking function code utility factories** (i.e., low-level callables dynamically generating pure-Python code snip...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Beartype decorator **type-checking expression snippets** (i.e., triple-quoted pure-Python string constants formatted and concatena...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype type-checking code factories** (i.e., low-level callables dynamically generating pure-Python code snippets type-checkin...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Beartype decorator **type-checking expression magic** (i.e., global string constants embedded in the implementations of boolean ex...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. # ....................{ TODO }.................... #FIXME: Add support for Python 3.10-specific PEPs and t...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype decorator PEP-compliant code wrapper scope utilities** (i.e., functions handling the possibly nested lexical scopes enc...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **PEP-agnostic type hint sanitizers** (i.e., high-level callables converting type hints from one format into another,...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **PEP-agnostic type hint reducers** (i.e., low-level callables converting type hints from one format into another, ei...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **PEP-agnostic type hint coercers** (i.e., mid-level callables converting type hints from one format into another, ei...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :mod:`typing` **compatibility layer.** This submodule declares the exact same set of **public typing attributes** (i...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype typing callable caching** (i.e., general-purpose memoization of function and method calls intended to be called *only* ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype** :pep:`544` **optimization layer.** This private submodule implements a :func:`beartype.beartype``-compatible (i.e., ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype all-at-once API.** This subpackage publishes :pep:`302`- and :pep:`451`-compliant import hooks enabling external calle...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype all-at-once low-level abstract syntax tree (AST) transformation.** This private submodule defines the low-level abstra...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype all-at-once low-level package name cache.** This private submodule caches package names on behalf of the higher-level ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype all-at-once low-level** :mod:`importlib` **module loading machinery.** This private submodule declares an :mod:`import...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype all-at-once high-level** :mod:`importlib` **machinery.** This private submodule is the main entry point for this subpa...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **container singletons** (i.e., instances of data structures commonly required throughout this codebase, reducing spa...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **PEP-compliant type hints** (i.e., hints annotating callables declared throughout this codebase, either for complian...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **bare PEP-compliant type hint representations** (i.e., global constants pertaining to machine-readable strings retur...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **Python version-agnostic signs** (i.e., instances of the :class:`beartype._data.hint.pep.sign.datapepsigncls.HintSig...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **type hint sign sets** (i.e., frozen set globals aggregating instances of the :class:`beartype._data.hint.pep.sign.d...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **sign classes** (i.e., classes whose instances uniquely identifying PEP-compliant type hints in a safe, non-deprecat...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **class globals** (i.e., global constants describing various well-known types). This private submodule is *not* inte...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **standard Python module globals** (i.e., global constants describing modules and packages bundled with CPython's sta...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **typing module globals** (i.e., global constants describing quasi-standard typing modules). This private submodule ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide **callable globals** (i.e., global constants describing various well-known functions and methods). This private subm...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype warning hierarchy.** This private submodule publishes a hierarchy of both public and private :mod:`beartype`-specific ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype exception and warning hierarchies.** This submodule publishes a hierarchy of: * :mod:`beartype`-specific exceptions r...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype exception hierarchy.** This private submodule publishes a hierarchy of both public and private :mod:`beartype`-specifi...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype configuration enumerations** (i.e., public enumerations whose members may be passed as initialization-time parameters t...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype configuration class hierarchy** (i.e., public dataclasses defining beartype's configuration API, enabling end users to ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype Decidedly Object-Oriented Runtime-checking (DOOR) procedural type-checkers** (i.e., high-level functions type-checking ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype Decidedly Object-Oriented Runtime-checking (DOOR) API.** This subpackage provides an object-oriented type hint class h...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype Decidedly Object-Oriented Runtime-checking (DOOR) testers** (i.e., callables testing and validating :class:`beartype.do...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' **Beartype Decidedly Object-Oriented Runtime-checking (DOOR) type hints** (i.e., PEP-compliant widely used throughout the :mod:`be...