Skip to content

property decorator doesn't work when aliased #2181

@almaslov

Description

@almaslov

When executing following code:

class my_property(property):
    pass


cdef class A:
    @my_property
    def x(self):
        pass

    @x.setter
    def x(self, value):
        pass


print(A.x.fget)
print(A.x.fset)

got invalid setter method:

<method 'x' of 'sample.A' objects>
<sample.my_property object at 0x7f6931c44048>

It seems that there's some name collision occurs when executing cdef class code.

Cython version 0.28.1
Python version 3.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions