MCPcopy Index your code
hub / github.com/python/cpython / Namespace

Class Namespace

Lib/argparse.py:1471–1488  ·  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

1469# ===========================
1470
1471class Namespace(_AttributeHolder):
1472 """Simple object for storing attributes.
1473
1474 Implements equality by attribute names and values, and provides a simple
1475 string representation.
1476 """
1477
1478 def __init__(self, **kwargs):
1479 for name in kwargs:
1480 setattr(self, name, kwargs[name])
1481
1482 def __eq__(self, other):
1483 if not isinstance(other, Namespace):
1484 return NotImplemented
1485 return vars(self) == vars(other)
1486
1487 def __contains__(self, key):
1488 return key in self.__dict__
1489
1490
1491class _ActionsContainer(object):

Callers 1

_parse_known_args2Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…