[IPython-dev] Overzealous introspection

Shashwath T.R. trshash84 at gmail.com
Tue Jan 27 06:54:20 EST 2009


On Fri, Jan 23, 2009 at 10:56 PM, Pauli Virtanen <pav at iki.fi> wrote:
> Fri, 23 Jan 2009 16:31:14 +0200, Ville M. Vainio wrote:
>
>> On Fri, Jan 23, 2009 at 3:15 PM, Mike Hansen <mhansen at gmail.com> wrote:
>>
>>> In [1]: def foo(x):
>>>   ...:     """
>>>   ...:     Eh?
>>> Object `Eh` not found.
>>>   ...:     """
>>>   ...:     return 4
>>>   ...:
>>>
>>> The function still gets defined.  I've verified that this is still an
>>
>> Eh? gets converted to valid python code, hence the function gets
>> defined. I don't think this is a bug.
>
> I think the bug is the "Object `Eh` not found." message. The string "Eh?"
> occurs as a string literal and IMHO IPython shouldn't try to look it up.
>
> --

Happens without declaring the function too:

In [2]: x="""
   ...: Eh?
Object `Eh` not found.
   ...: """

And now, the string is actually empty...

In [3]: x
Out[3]: '\n\n'

In [4]: print x



In [5]:

Definitely a bug, I think?

Shash



More information about the IPython-dev mailing list