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


Groups > comp.lang.python > #39540 > unrolled thread

Re: subclassable types

Started byChristian Heimes <christian@python.org>
First post2013-02-22 12:00 +0100
Last post2013-02-22 12:00 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#39540 — Re: subclassable types

FromChristian Heimes <christian@python.org>
Date2013-02-22 12:00 +0100
SubjectRe: subclassable types
Message-ID<mailman.2248.1361530860.2939.python-list@python.org>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web