make[3]: Map ‘/home/benedict/prj/pyformex’ wordt binnengegaan running build_ext building ‘pyformex/lib/misc_’ extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.7m -c pyformex/lib/misc_.c -o build/temp.linux-x86_64-3.7/pyformex/lib/misc_.o make[3]: Map ‘/home/benedict/prj/pyformex’ wordt verlaten
The compiled library ‘misc_’ is not up to date! The compiled library ‘nurbs_’ is not up to date! Rebuilding pyFormex libraries, please wait Running command: cd /home/benedict/prj/pyformex/pyformex/..; make lib3 .. -- rst -- .. pyformex reference manual — attributes .. CREATED WITH pyformex –docmodule: DO NOT EDIT
30. attributes — Attributes¶
This module defines a general class for adding extra attributes to other objects without cluttering the name space.
- 
class attributes.Attributes(default_factory=<function Dict.returnNone>, *args, **kargs)[source]¶
- A general class for holding attributes. - This class is a versatile Mapping class for objects that need a customizable set of attributes, while avoiding a wildly expanding name space. - The class derives from - Dictand therefore has key lookup via normal dict key mechanism or via attribute syntax or via function call. It also provides a default_factory to lookup missing keys.- The difference with the - Dictclass are:- The function call can also be used to populate or update the contents of the Mapping.
- By default, a default_factory is set returning None for any missing key.
- Giving an attribute the value None removes it from the Mapping.
 - Parameters: - default_factory (callable, optional) – If provided, missing keys will be looked up by a call to the default_factory.
- kargs (args,) – Any other arguments are passed to the dict initialization.
 - Notes - While setting a single item to None will remove the item from the Attributes, None values can be entered using the update() method. - The parameter order is different from previous implementation of this class. This was done for consistency with the Dict and CDict classes. - Examples - >>> A = Attributes() >>> A Attributes({}) >>> A(color='red',alpha=0.7,ontop=True) >>> A Attributes({'color': 'red', 'alpha': 0.7, 'ontop': True}) >>> A['alpha'] = 0.8 >>> A.color = 'blue' >>> A.ontop = None # remove 'ontop' >>> A Attributes({'color': 'blue', 'alpha': 0.8}) >>> A = Attributes({'alpha': 0.8, 'color': 'blue'}) >>> A.ontop is None True - Create another Attributes with A as default, override color: - >>> B = Attributes(default_factory=A, color='green') >>> B Attributes({'color': 'green'}) >>> B.color, B.alpha # alpha found in A ('green', 0.8) >>> A.clear() >>> A Attributes({}) >>> A['alpha'], A.alpha, A('alpha') # all mechanisms still working (None, None, None) >>> B['alpha'], B.alpha, B('alpha') (None, None, None) >>> B(color=None,alpha=1.0) # remove and change in 1 operation >>> B Attributes({'alpha': 1.0}) >>> B.update(color=None) # update can be used to enter None values. >>> B Attributes({'alpha': 1.0, 'color': None}) >>> B['alpha'] = None >>> B Attributes({'color': None}) 
 
  