robertwb / issues-import-test

0 stars 0 forks source link

Getting unbound method returns descriptor instead of unbound method #105

Open robertwb opened 7 years ago

robertwb commented 7 years ago

Reported by socketpair on 23 Oct 2015 14:58 UTC

=======================
Trying to use in cython:

cdef class Sample:
   def __init__(self):
       xxx = self.meth.__code__ # will raise exception saying that no such attribute

   def meth(self):
       pass
=======================
Doing the same in pure python will not raise exception:

class Sample:
   def __init__(self):
       xxx = self.meth.__code__ # will NOT raise exception saying that no such attribute

Migrated-From: http://trac.cython.org/ticket/872