"No definition found"

Juan Nunez-Iglesias jni.soma at gmail.com
Wed Jan 9 23:35:58 EST 2013


Hmm. Well IPython seems to work fine with unicode docstrings in when you
specify the encoding, in Python files at least...

def foo(x):
    """Añadir 1 al número deseado."""
    return x + 1


gives

In [1]: import foo
  File "foo.py", line 2
SyntaxError: Non-ASCII character '\xc3' in file foo.py on line 2, but
no encoding declared; see http://www.python.org/peps/pep-0263.html for
details


but placing the line `# coding=utf-8` at the start of the file gives:

In [2]: import foo

In [3]: %pdoc foo.foo
Class Docstring:
    Añadir 1 al número deseado.
Calling Docstring:
    x.__call__(...) <==> x(...)


So maybe it's a Cython thing?

Science is tricky... ;)

On Tue, Jan 8, 2013 at 2:14 AM, Stéfan van der Walt <stefan at sun.ac.za>wrote:

> On Sun, Jan 6, 2013 at 10:35 PM, Juan Nunez-Iglesias <jni.soma at gmail.com>
> wrote:
> >> Not sure--but this also shows that IPython does not handle unicode
> >> characters in a docstring correctly!
> >
> > Huh? Are you jumping to conclusions or did you test this?
>
> I patched the Cython docstring to remove all unicode
> characters--everything then worked fine.
>
> Stéfan
>
> --
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130110/d4e0c4d5/attachment.html>


More information about the scikit-image mailing list