Re: (no subject)

Vasilis Vlachoudis <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
Thank you!

________________________________________
From: Tkinter-discuss [[email protected]] on behalf of Michael Lange [[email protected]]
Sent: 31 May 2015 11:39
To: [email protected]
Subject: Re: [Tkinter-discuss] (no subject)

Hi,

On Sun, 31 May 2015 09:21:20 +0000
Vasilis Vlachoudis <[email protected]> wrote:

> Hi All,
>
> my question is not tkinter related but I could not find any help on that
> I am compiling a list of commands for faster access in my application.
> How can I check the type of a compiled object with isinstance()?
>
> >>> c = compile("x+y","","eval")
>
> >>> isinstance(c,code)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'code' is not defined
>
> While type(c) gives a "code" object?
>
> >>> c
> <code object <module> at 0xb74a5cc8, file "", line 1>
>
> >>> type(c)
> <type 'code'>

Maybe you will have to use

    isinstance(c, types.CodeType)

instead.

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

The sooner our happiness together begins, the longer it will last.
                -- Miramanee, "The Paradise Syndrome", stardate 4842.6
_______________________________________________
Tkinter-discuss mailing list
[email protected]
https://mail.python.org/mailman/listinfo/tkinter-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.