openglider.utils¶
- class openglider.utils.dualmethod(func)[source]¶
Bases:
objectA Decorator to have a combined class-/instancemethod
>>>class a: … @dualmethod … def test(this): … return this … >>>a.test() <class ‘__main__.a’> >>>a().test() <__main__.a object at 0x7f133b5f7198> >>>
an instance-check could be:
is_instance = not type(this) is type