- update to 4.0.0:
* Fixed ``@typechecked`` optimization causing compilation of instrumented code to fail when an ``if`` block was left empty by the AST transformer * Fixed the AST transformer trying to parse the second argument of ``typing.Annotated`` as a forward reference * Added ``InstrumentationWarning`` to the public API * Changed ``@typechecked`` to skip instrumentation in optimized mode, as in typeguard 2.x * Avoid type checks where the types in question are shadowed by local variables * Fixed instrumentation using ``typing.Optional`` without a subscript when the subscript value was erased due to being an ignored import * Fixed ``TypeError: isinstance() arg 2 must be a type or tuple of types`` when instrumented code tries to check a value against a naked (``str``, not ``ForwardRef``) * forward reference * Fixed instrumentation using the wrong "self" type in the ``__new__()`` method * Fixed imports guarded by ``if TYPE_CHECKING:`` when used with subscripts * (``SomeType[...]``) being replaced with ``Any[...]`` instead of just ``Any`` * Fixed instrumentation inadvertently mutating a function's annotations on Python 3.7 and 3.8 * Fixed ``Concatenate[...]`` in ``Callable`` parameters causing ``TypeError`` to be raised * Fixed type checks for ``*args`` or ``**kwargs`` not being suppressed when their types are unusable OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typeguard?expand=0&rev=8
This commit is contained in:
parent
065aa08ad3
commit
6436ad7278
@ -1,3 +1,81 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun May 14 16:35:53 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 4.0.0:
|
||||
* Fixed ``@typechecked`` optimization causing compilation of
|
||||
instrumented code to fail when an ``if`` block was left
|
||||
empty by the AST transformer
|
||||
* Fixed the AST transformer trying to parse the second argument
|
||||
of ``typing.Annotated`` as a forward reference
|
||||
* Added ``InstrumentationWarning`` to the public API
|
||||
* Changed ``@typechecked`` to skip instrumentation in optimized
|
||||
mode, as in typeguard 2.x
|
||||
* Avoid type checks where the types in question are shadowed by
|
||||
local variables
|
||||
* Fixed instrumentation using ``typing.Optional`` without a
|
||||
subscript when the subscript value was erased due to
|
||||
being an ignored import
|
||||
* Fixed ``TypeError: isinstance() arg 2 must be a type or tuple
|
||||
of types`` when instrumented code tries to check a value
|
||||
against a naked (``str``, not ``ForwardRef``)
|
||||
* forward reference
|
||||
* Fixed instrumentation using the wrong "self" type in the
|
||||
``__new__()`` method
|
||||
* Fixed imports guarded by ``if TYPE_CHECKING:`` when used with
|
||||
subscripts
|
||||
* (``SomeType[...]``) being replaced with ``Any[...]`` instead
|
||||
of just ``Any``
|
||||
* Fixed instrumentation inadvertently mutating a function's
|
||||
annotations on Python 3.7 and 3.8
|
||||
* Fixed ``Concatenate[...]`` in ``Callable`` parameters causing
|
||||
``TypeError`` to be raised
|
||||
* Fixed type checks for ``*args`` or ``**kwargs`` not being
|
||||
suppressed when their types are unusable
|
||||
(guarded by ``if TYPE_CHECKING:`` or otherwise)
|
||||
* Fixed ``TypeError`` when checking against a generic
|
||||
``NewType``
|
||||
* Don't try to check types shadowed by argument names (e.g.
|
||||
* ``def foo(x: type, type: str): ...``)
|
||||
* Don't check against unions where one of the elements is
|
||||
* Fixed ``typing.Literal`` subscript contents being evaluated
|
||||
as forward references
|
||||
* Fixed resolution of forward references in type aliases
|
||||
* The ``.pyc`` files now use a version-based optimization
|
||||
suffix in the file names so as not to cause the
|
||||
interpreter to load potentially faulty/incompatible cached
|
||||
bytecode generated by older versions
|
||||
* Fixed typed variable positional and keyword arguments causing
|
||||
compilation errors on Python 3.7 and 3.8
|
||||
* Fixed compilation error when a type annotation contains a
|
||||
type guarded by ``if TYPE_CHECKING:``
|
||||
* **BACKWARD INCOMPATIBLE** ``check_type()`` no longer uses the
|
||||
global configuration.
|
||||
* It now uses the default configuration values, unless
|
||||
overridden with an explicit ``config`` argument.
|
||||
* **BACKWARD INCOMPATIBLE** Removed ``CallMemo`` from the API
|
||||
* **BACKWARD INCOMPATIBLE** Required checkers to use the
|
||||
configuration from ``memo.config``, rather than the global
|
||||
configuration
|
||||
* Added keyword arguments to ``@typechecked``, allowing users
|
||||
to override settings on a per-function basis
|
||||
* Added support for using ``suppress_type_checks()`` as a
|
||||
decorator
|
||||
* Added support for type checking against nonlocal classes
|
||||
defined within the same
|
||||
* parent function as the instrumented function
|
||||
* Changed instrumentation to statically copy the function
|
||||
annotations to avoid having to
|
||||
* look up the function object at run time
|
||||
* Improved support for avoiding type checks against imports
|
||||
declared in ``if TYPE_CHECKING:`` blocks
|
||||
* Fixed ``check_type`` not returning the passed value when
|
||||
checking against ``Any``, or when type checking is being
|
||||
suppressed
|
||||
* Fixed ``suppress_type_checks()`` not ending the suppression
|
||||
if the context block raises an exception
|
||||
* Fixed checking non-dictionary objects against a ``TypedDict``
|
||||
annotation
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 5 09:24:37 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
%define skip_python2 1
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-typeguard
|
||||
Version: 3.0.2
|
||||
Version: 4.0.0
|
||||
Release: 0
|
||||
Summary: Library for runtime checking of Python types
|
||||
License: MIT
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fee5297fdb28f8e9efcb8142b5ee219e02375509cd77ea9d270b5af826358d5a
|
||||
size 58171
|
BIN
typeguard-4.0.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
typeguard-4.0.0.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user