Original patch by John Mark Vandenberg.
cls = self
else:
cls = self.__class__
- elif ismethoddescriptor(obj) or isdatadescriptor(obj):
- name = obj.__name__
- cls = obj.__objclass__
- if getattr(cls, name) is not obj:
- return None
+ # Should be tested before isdatadescriptor().
elif isinstance(obj, property):
- func = f.fget
+ func = obj.fget
name = func.__name__
cls = _findclass(func)
if cls is None or getattr(cls, name) is not obj:
return None
+ elif ismethoddescriptor(obj) or isdatadescriptor(obj):
+ name = obj.__name__
+ cls = obj.__objclass__
+ if getattr(cls, name) is not obj:
+ return None
else:
return None
self.ex = sys.exc_info()
self.tr = inspect.trace()
+ @property
def contradiction(self):
'The automatic gainsaying.'
pass
-# line 48
+# line 53
class MalodorousPervert(StupidGit):
def abuse(self, a, b, c):
pass
+
+ @property
def contradiction(self):
pass
class FesteringGob(MalodorousPervert, ParrotDroppings):
def abuse(self, a, b, c):
pass
+
+ @property
def contradiction(self):
pass
def test_getsource(self):
self.assertSourceEqual(git.abuse, 29, 39)
- self.assertSourceEqual(mod.StupidGit, 21, 50)
- self.assertSourceEqual(mod.lobbest, 70, 71)
+ self.assertSourceEqual(mod.StupidGit, 21, 51)
+ self.assertSourceEqual(mod.lobbest, 75, 76)
def test_getsourcefile(self):
self.assertEqual(normcase(inspect.getsourcefile(mod.spam)), modfile)
Ville Vainio
Andi Vajda
Case Van Horsen
+John Mark Vandenberg
Kyle VanderBeek
Andrew Vant
Atul Varma
Library
-------
+- Issue #25503: Fixed inspect.getdoc() for inherited docstrings of properties.
+ Original patch by John Mark Vandenberg.
+
- Issue #21827: Fixed textwrap.dedent() for the case when largest common
whitespace is a substring of smallest leading whitespace.
Based on patch by Robert Li.