Language Features

PyDataclasses

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

Other Methods

.asdict()Neutral
#
Signature
asdict(obj, dict_factory)

Return the fields of a dataclass instance as a new dictionary mapping

.astuple()Neutral
#
Signature
astuple(obj, tuple_factory)

Return the fields of a dataclass instance as a new tuple of field values.

.dataclass()Neutral
#
Signature
dataclass(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)

Add dunder methods based on the fields defined in the class.

.field()Neutral
#
Signature
field(default, default_factory, init, repr, hash, compare, metadata, kw_only)

Return an object to identify dataclass fields.

.fields()Neutral
#
Signature
fields(class_or_instance)

Return a tuple describing the fields of this dataclass.

.is_dataclass()Neutral
#
Signature
is_dataclass(obj)

Returns True if obj is a dataclass or an instance of a

.make_dataclass()Neutral
#
Signature
make_dataclass(cls_name, fields, bases, namespace, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)

Return a new dynamically created dataclass.

.replace()Neutral
#
Signature
replace(obj, changes)

Return a new object replacing specified fields with new values.

.Field()Neutral
#
Signature
Field(...)

Field class.

.FrozenInstanceError()Neutral
#
Signature
FrozenInstanceError(...)

FrozenInstanceError class.

Fully-Qualified Names

FQNField
dataclassesfqns[0]

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

Import

rule.py
import dataclasses