MCPcopy Index your code
hub / github.com/numpy/numpy / __setattr__

Method __setattr__

numpy/ma/core.py:6842–6852  ·  view source on GitHub ↗
(self, attr, value)

Source from the content-addressed store, hash-verified

6840 return self
6841
6842 def __setattr__(self, attr, value):
6843 if not self.__has_singleton():
6844 # allow the singleton to be initialized
6845 return super().__setattr__(attr, value)
6846 elif self is self.__singleton:
6847 raise AttributeError(
6848 f"attributes of {self!r} are not writeable")
6849 else:
6850 # duplicate instance - we can end up here from __array_finalize__,
6851 # where we set the __class__ attribute
6852 return super().__setattr__(attr, value)
6853
6854
6855masked = masked_singleton = MaskedConstant()

Callers

nothing calls this directly

Calls 1

__has_singletonMethod · 0.95

Tested by

no test coverage detected