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

# Module named

(INTERNAL) Classes `_Named`, `_NamedDict` and `_NamedTuple`, all with nameable instances and several subclasses thereof.

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

Results previously returned as tuples by `pygeodesy` functions and class methods are now instances of some `...Tuple` class, all sub-classes of `_NamedTuple` defined here.

Version: 20.09.16

Classes
| _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) Get the name of the calling 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, name, *args, **kwds) Raise a `NotImplementedError` for a missing method or property. |
notOverloaded(inst, name, *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) |
Get the name of the calling callable. Arguments: `up` - Number of call stack frames up (`int`). `dflt` - Default return value (`any`). `source` - Include source file name and line number (`bool`). Returns: Name of the non-internal callable (`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, name, *args, **kwds) |
Raise a `NotImplementedError` for a missing method or property. Arguments: `inst` - Instance (`any`). `name` - Method, property or name (`str` or `callable`). `args` - Method or property positional arguments (any `type`s). `kwds` - Method or property keyword arguments (any `type`s).

### notOverloaded (inst, name, *args, **kwds) |
Raise an `AssertionError` for a method or property not overloaded. Arguments: `inst` - Instance (`any`). `name` - Method, property or name (`str` or `callable`). `args` - Method or property positional arguments (any `type`s). `kwds` - Method or property keyword arguments (any `type`s).