Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #39540

Re: subclassable types

From Christian Heimes <christian@python.org>
Subject Re: subclassable types
Date 2013-02-22 12:00 +0100
References <loom.20130222T101853-588@post.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.2248.1361530860.2939.python-list@python.org> (permalink)

Show all headers | View raw


Am 22.02.2013 10:35, schrieb Wolfgang Maier:
> Also: can you use introspection to find out whether a type is valid as a
> base type?

I don't think so. For CPython the information is stored in the type's
structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then
subclassing is allowed. But I know of no way to retrieve that
information from Python code.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: subclassable types Christian Heimes <christian@python.org> - 2013-02-22 12:00 +0100

csiph-web