What is the name of the name space I am in?
Anthra Norell
anthra.norell at bluewin.ch
Mon Jul 5 09:26:03 EDT 2010
Chris Rebert wrote:
> On Mon, Jul 5, 2010 at 2:07 AM, Anthra Norell <anthra.norell at bluewin.ch> wrote:
>
>> I try to use "new.new.classobj (name, baseclass, dict)" and have no clue
>>
>
> Slight tangent:
> Note that both the `new` module and old-style classes (which are what
> `classobj` produces) are deprecated.
> To produce new-style classes dynamically, use `type`.
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
>
Chris,
I noticed the deprecation situation reading the doc, but opted for
what I thought might be more backward-compatible. Your suggestion
prompted me to take a closer look and it turns out that "types" is
compatible as far back as I have to go (2.5). So I use "types" with
thanks to you.
More information about the Python-list
mailing list