Message199740
| Author |
ethan.furman |
| Recipients |
arigo, eli.bendersky, eric.snow, ethan.furman, ncoghlan, ronaldoussoren |
| Date |
2013年10月13日.18:04:31 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1381687472.34.0.220044994167.issue16938@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
That portion of classify_class_attrs now reads:
else:
homecls = getattr(get_obj, "__objclass__", None)
if homecls not in possible_bases:
# if the resulting object does not live somewhere in the
# mro, drop it and go with the dict_obj version only
homecls = None
get_obj = sentinel
An example for why the if clause is still there:
class Life:
@property
def answer(self):
return 42
Without the if clause the home class for answer would be int when it should be Life.
Attached patch is refactored for simplicity as well. |
|