Language Features

PyTyping

Python stdlib module — typing. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.NamedTuple()Neutral
#
Signature
NamedTuple(typename, fields, kwargs)

Typed version of namedtuple.

.TypedDict()Neutral
#
Signature
TypedDict(typename, fields, total, kwargs)

A simple typed namespace. At runtime it is equivalent to a plain dict.

.abstractmethod()Neutral
#
Signature
abstractmethod(funcobj)

A decorator indicating abstract methods.

.assert_never()Neutral
#
Signature
assert_never(arg)

Statically assert that a line of code is unreachable.

.assert_type()Neutral
#
Signature
assert_type(val, typ)

Ask a static type checker to confirm that the value is of the given type.

.cast()Neutral
#
Signature
cast(typ, val)

Cast a value to a type.

.clear_overloads()Neutral
#
Signature
clear_overloads()

Clear all overloads in the registry.

.dataclass_transform()Neutral
#
Signature
dataclass_transform(eq_default, order_default, kw_only_default, field_specifiers, kwargs)

Decorator to mark an object as providing dataclass-like behaviour.

.final()Neutral
#
Signature
final(f)

Decorator to indicate final methods and final classes.

.get_args()Neutral
#
Signature
get_args(tp)

Get type arguments with all substitutions performed.

Fully-Qualified Names

FQNField
typingfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
import typing