Package pygeodesy :: Module named |
[frames] | no frames]

# Module named

(INTERNAL) Nameable class instances.

Classes `_Named`, `_NamedDict`, `_NamedEnum`, `_NamedEnumItem` and `_NamedTuple` and several subclasses thereof, all with nameable instances.

The items in a `_NamedDict` are accessable as attributes and the items in a `_NamedTuple` are named to be accessable as attributes, similar to standard Python `namedtuple`s.

See Also: Module pygeodesy.namedTuples for (most of) the `Named-Tuples`.

Version: 24.08.13

Classes
| ADict A `dict` with both key and attribute access to the `dict` items.
| _Named (INTERNAL) Root class for named objects.
| _NamedBase (INTERNAL) Base class with name.
| _NamedEnum (INTERNAL) Enum-like `_NamedDict` with attribute access restricted to valid keys.
| _NamedEnumItem (INTERNAL) Base class for items in a `_NamedEnum` registery.
| _NamedTuple (INTERNAL) Base for named `tuple`s with both index and attribute name access to the items.

Functions
callername(up=1, dflt='', source=False, underOK=False) Get the name of the invoking callable. |
classname(inst, prefixed=None) Return the instance' class name optionally prefixed with the module name. |
classnaming(prefixed=None) Get/set the default class naming for `[module.]class` names. |
modulename(clas, prefixed=None) Return the class name optionally prefixed with the module name. |
nameof(inst) Get the name of an instance. |
notImplemented(inst, *args, **kwds) Raise a `NotImplementedError` for a missing instance method or property or for a missing caller feature. |
notOverloaded(inst, *args, **kwds) Raise an `AssertionError` for a method or property not overloaded. |

Variables
| __all__ = `_ALL_LAZY.named`

Function Details

### callername (up=1, dflt='', source=False, underOK=False) |
Get the name of the invoking callable. Arguments: `up` - Number of call stack frames up (`int`). `dflt` - Default return value (`any`). `source` - Include source file name and line number (`bool`). `underOK` - If `True`, private, internal callables are OK, otherwise private callables are skipped (`bool`). Returns: The callable name (`str`) or `dflt` if none found.

### classname (inst, prefixed=None) |
Return the instance' class name optionally prefixed with the module name. Arguments: `inst` - The object (any `type`). `prefixed` - Include the module name (`bool`), see function `classnaming`. Returns: The `inst`'s `[module.]class` name (`str`).

### classnaming (prefixed=None) |
Get/set the default class naming for `[module.]class` names. Arguments: `prefixed` - Include the module name (`bool`). Returns: Previous class naming setting (`bool`).

### modulename (clas, prefixed=None) |
Return the class name optionally prefixed with the module name. Arguments: `clas` - The class (any `class`). `prefixed` - Include the module name (`bool`), see function `classnaming`. Returns: The `class`'s `[module.]class` name (`str`).

### nameof (inst) |
Get the name of an instance. Arguments: `inst` - The object (any `type`). Returns: The instance' name (`str`) or `""`.

### notImplemented (inst, *args, **kwds) |
Raise a `NotImplementedError` for a missing instance method or property or for a missing caller feature. Arguments: `inst` - Caller instance (`any`) or `None` for function. `args` - Method or property positional arguments (any `type`s). `kwds` - Method or property keyword arguments (any `type`s), except `callername=NN`, `underOK=False` and `up=2`.

### notOverloaded (inst, *args, **kwds) |
Raise an `AssertionError` for a method or property not overloaded. Arguments: `inst` - Instance (`any`). `args` - Method or property positional arguments (any `type`s). `kwds` - Method or property keyword arguments (any `type`s), except `callername=NN`, `underOK=False` and `up=2`.