Writing this down so I don't forget.
One of the goals is to be able to distribute partialplus.py with your project and have it interoperate with other projects that bundle partialplus.py (or searchspaces). To save ourselves computation and headaches, we need a way of checking that objects are PartialPlus objects (or special functions defined by partialplus as node markers) without using isinstance/equality checks on functions.
The plan:
- Add a class-level
_partialplus_version_ attribute to Node.
- For
make_* and *_node functions, add a decorator @annotate_version that adds a 'partialplus_version' attribute, equal to partialplus's __version__.
- All the
is_* functions should then check the function's name attribute and the _partialplus_version_ attribute (there should be a separate function that checks that __version__ is greater than or equal to the node's _partialplus_version_).
Writing this down so I don't forget.
One of the goals is to be able to distribute
partialplus.pywith your project and have it interoperate with other projects that bundlepartialplus.py(orsearchspaces). To save ourselves computation and headaches, we need a way of checking that objects are PartialPlus objects (or special functions defined bypartialplusas node markers) without using isinstance/equality checks on functions.The plan:
_partialplus_version_attribute toNode.make_*and*_nodefunctions, add a decorator @annotate_version that adds a 'partialplus_version' attribute, equal to partialplus's__version__.is_*functions should then check the function's name attribute and the_partialplus_version_attribute (there should be a separate function that checks that__version__is greater than or equal to the node's_partialplus_version_).