[Cython] Cython and Py2.6/Py2.7 format() differences: '{}' vs. '{0}'

Stefan Behnel stefan_ml at behnel.de
Fri Jul 5 15:52:42 CEST 2013


Yury V. Zaytsev, 05.07.2013 14:40:
> I have just discovered that if one uses Python 2.7 constructs in the
> code like
> 
>     print("Object: {}".format(obj))
> 
> the resulting C++ module compiles just fine with both Python 2.6 and
> Python 2.7 headers, however, in the former case, ValueError is raised at
> runtime:
> 
>     ValueError: zero length field name in format
> 
> Is this an intended behavior or Cython should have abstracted this
> difference for me, and it can be considered a bug?

Cython has nothing to do with this.

Stefan



More information about the cython-devel mailing list