[Python-Dev] Semantic of isinstance

2006-06-26 Thread Martin Maly
Hello Python Dev, I am trying to understand the correct semantic of the isinstance built-in function and while doing so, I came across few cases which raise some questions. 1) First example - a class instance pretends to have different class via __class__. class D(object): ... def

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Martin Maly
Message- From: Greg Ewing [mailto:[EMAIL PROTECTED] Sent: Monday, June 26, 2006 8:00 PM To: Martin Maly Cc: python-dev@python.org Subject: Re: [Python-Dev] Semantic of isinstance Martin Maly wrote: isinstance(D(), D) True isinstance(D(), C) D.getclass True This looks like a new/old

[Python-Dev] Bug in from __future__ processing?

2006-03-03 Thread Martin Maly
Hello, The Python spec states that the from __future__ import statement can only occur at the beginning of the file, preceded only by doc strings, comments, empty lines or other future statements. The following code snippets, however, dont raise Syntax error in Python 2.4.2. Is it a