Lines Matching refs:attr
125 def is_internal_attribute(obj: t.Any, attr: str) -> bool:
138 if attr in UNSAFE_FUNCTION_ATTRIBUTES:
141 if attr in UNSAFE_FUNCTION_ATTRIBUTES or attr in UNSAFE_METHOD_ATTRIBUTES:
144 if attr == "mro":
149 if attr in UNSAFE_GENERATOR_ATTRIBUTES:
152 if attr in UNSAFE_COROUTINE_ATTRIBUTES:
157 if attr in UNSAFE_ASYNC_GENERATOR_ATTRIBUTES:
159 return attr.startswith("__")
162 def modifies_known_mutable(obj: t.Any, attr: str) -> bool:
183 return attr in unsafe
202 #: :attr:`binop_table`
215 #: :attr:`unop_table`
224 #: operator callback is specified by :attr:`binop_table`.
240 #: operator callback is specified by :attr:`unop_table`.
258 def is_safe_attribute(self, obj: t.Any, attr: str, value: t.Any) -> bool:
265 return not (attr.startswith("_") or is_internal_attribute(obj, attr))
307 attr = str(argument)
312 value = getattr(obj, attr)
402 def is_safe_attribute(self, obj: t.Any, attr: str, value: t.Any) -> bool:
403 if not super().is_safe_attribute(obj, attr, value):
406 return not modifies_known_mutable(obj, attr)