C API: how to tell if x is a new style instance?
gerrit at nl.linux.org
Thu Jan 29 17:05:12 CET 2004
Mike C. Fletcher wrote:
> Well, I don't actually know how to check for the spiritual state of a
> new-style class, but here's how to tell if an instance is an instance of
> a new-style class:
> * Note that a new-style class is a sub-class of type, while
> old-style classes are not
I think you mean instance here?
>>> issubclass(int, type)
>>> isinstance(int, type)
2. If any one bring an accusation against a man, and the accused go to
the river and leap into the river, if he sink in the river his accuser
shall take possession of his house. But if the river prove that the
accused is not guilty, and he escape unhurt, then he who had brought the
accusation shall be put to death, while he who leaped into the river shall
take possession of the house that had belonged to his accuser.
-- 1780 BC, Hammurabi, Code of Law
PrePEP: Builtin path type
Asperger's Syndrome - a personal approach:
More information about the Python-list