[Zope] Using builtin "type" function in a Python FS product

J Cameron Cooper jccooper at jcameroncooper.com
Wed Oct 15 17:12:42 EDT 2003


Gilles Lenfant wrote:

>Is there changes in this usual Python builtin ?
>
>import types
>
># somewhere in a method...
>
>if type(x) == types.UnicodeType:
>
>Raises...
>
>Error Type: UnboundLocalError
>Error Value: local variable 'type' referenced before assignment
>
>What did I miss ?
>
It seems to work elsewhere. OFS/Image.py, for instance, and lots of 
other places.

How does it work without the surrounding code?

          --jcc




More information about the Zope mailing list