MCPcopy Index your code
hub / github.com/RustPython/RustPython / __dir__

Method __dir__

Lib/unittest/mock.py:787–802  ·  view source on GitHub ↗

Filter the output of `dir(mock)` to only useful members.

(self)

Source from the content-addressed store, hash-verified

785
786
787 def __dir__(self):
788 """Filter the output of `dir(mock)` to only useful members."""
789 if not FILTER_DIR:
790 return object.__dir__(self)
791
792 extras = self._mock_methods or []
793 from_type = dir(type(self))
794 from_dict = list(self.__dict__)
795 from_child_mocks = [
796 m_name for m_name, m_value in self._mock_children.items()
797 if m_value is not _deleted]
798
799 from_type = [e for e in from_type if not e.startswith('_')]
800 from_dict = [e for e in from_dict if not e.startswith('_') or
801 _is_magic(e)]
802 return sorted(set(extras + from_type + from_dict + from_child_mocks))
803
804
805 def __setattr__(self, name, value):

Callers

nothing calls this directly

Calls 7

dirFunction · 0.85
listClass · 0.85
_is_magicFunction · 0.85
sortedFunction · 0.85
setFunction · 0.85
itemsMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected