schlichtanders.myobjects module¶
Again a favourit package: Objects for everything. Namespaces, Counts, and something I am really proud of:
Structure. A Structure kind of implements a mixture between dicts and nested lists, which is highly useful for
python-like complex access to datastructures. E.g. pyparsing uses a similar interface for its ParseResult.
-
class
schlichtanders.myobjects.Count(_value=None)[source]¶ Bases:
objectfuture-like counting object
The first time the attribute
valueis accessed, it gets computed by counting onwards from the total_count-
total_count= 0¶
-
value¶
-
weakrefs= []¶
-
-
class
schlichtanders.myobjects.LazyProxy(initializer, *args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.ObjectProxythis is an amazing class which allows you to postpone the initalization of an object until an attribute of it is asked for or it is called like a function
-
is_initialized¶
-
-
class
schlichtanders.myobjects.Namespace(_dict=None, **kwargs)[source]¶ Bases:
objectsimple class to use as namespace (like a struct object in Matlab)
-
class
schlichtanders.myobjects.OrderedSet(iterable=None)[source]¶ Bases:
_abcoll.MutableSetSet the remembers the order elements were added
-
class
schlichtanders.myobjects.Structure(initializer='None', struct=None, leaves=None)[source]¶ Bases:
_abcoll.Sequenceimplements generic dict-list-combining structure like it is used in pyparsing.ParseResult
-
EMPTY_DEFAULT= 'EMPTY'¶
-
FLATTEN_LISTS= True¶
-
KEY_ACCESS_REDUCE_SINGLETONS= False¶ By default all key access return lists. With this option set to true, keys delivering singleton [object] will return object directly
-
LeafError= (<type 'exceptions.TypeError'>, <type 'exceptions.KeyError'>)¶
-