Ticket #454 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

@classmethod implementation leaves first argument with incorrect type

Reported by: scoder Owned by: scoder
Priority: major Milestone: 0.12.1
Component: Type Analysis Keywords:
Cc:

Description

cdef class TypeWithFactory:
    @classmethod
    def new(type cls):
        return cls.__new__(cls)

assigns the type TypeWithFactory to cls, instead of type.

Also, the parameter declaration as type shouldn't be necessary, as Cython should know that it must be a subtype of TypeWithFactory anyway.

Change History

Changed 4 years ago by scoder

  • milestone changed from 0.12 to 0.12.1

Retargeting to 0.12.1 as this isn't likely enough to cause trouble (and trivial enough to fix) to make it worth delaying 0.12 for it.

Changed 3 years ago by scoder

  • owner changed from somebody to scoder

A "should work in most cases" fix is here:

 http://hg.cython.org/cython-devel/rev/016f79ac7df1

Changed 3 years ago by scoder

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.