Commit 91a434d5 authored by Kirill Smelkov's avatar Kirill Smelkov

golang: Add support for @func(Class) and @func to be used over @property

Since the beginning of pygolang it is possible to define methods
separate from class. For example

    @func(MyClass)
    def my_method(self, ...):
        ...

will define MyClass.my_method(*). This works for regular functions and
staticmethod/classmethod as well. But support for properties was missing
because there was no use case so far.

-> Add support for properties as well as I hit the need for it during my
work on wendelin.core monitoring.

Test class changed to inherit from object since on py2 properties work
only for new-style classes.

(*) see afa46cf5 (Turn pygopath into full pygolang) and 942ee900
    (golang: Deprecate @method(cls) in favour of @func(cls)) for details.

/reviewed-by @levin.zimmermann
/reviewed-on nexedi/pygolang!31
parent 5302558e
Pipeline #38409 passed with stage
in 0 seconds