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

Class Namespace

Lib/argparse.py:1395–1412  ·  view source on GitHub ↗

Simple object for storing attributes. Implements equality by attribute names and values, and provides a simple string representation.

Source from the content-addressed store, hash-verified

1393# ===========================
1394
1395class Namespace(_AttributeHolder):
1396 """Simple object for storing attributes.
1397
1398 Implements equality by attribute names and values, and provides a simple
1399 string representation.
1400 """
1401
1402 def __init__(self, **kwargs):
1403 for name in kwargs:
1404 setattr(self, name, kwargs[name])
1405
1406 def __eq__(self, other):
1407 if not isinstance(other, Namespace):
1408 return NotImplemented
1409 return vars(self) == vars(other)
1410
1411 def __contains__(self, key):
1412 return key in self.__dict__
1413
1414
1415class _ActionsContainer(object):

Callers 1

_parse_known_args2Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected