robertwb / issues-import-test

0 stars 0 forks source link

Getting unbound method returns descriptor instead of unbound method #1023

Open robertwb opened 9 years ago

robertwb commented 9 years ago
=======================
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