[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python coding help: Has anybody seen this syntax



On Thu, Feb 13, 2014 at 5:37 PM, Andreas Tille <andreas@an3as.eu> wrote:
> Hi,
>
> I'm trying to package spades[1] and found the following code inside an
> __init__.py file:
>
>
>
>   File "/usr/share/spades/pyyaml3/__init__.py", line 284
>     class YAMLObject(metaclass=YAMLObjectMetaclass):
>                               ^
> SyntaxError: invalid syntax
>
>
>
> I'm not a very skilled Python coder but IMHO the critical line should be
> replaced by
>
>
> class YAMLObject(YAMLObjectMetaclass):
>
>
>
> Is this correct?  Do you have any clue whether this is some old syntax
> or what sensible hint I might give to upstream?
>

no this is python3 syntax

see here for the python2 syntax:
http://mikewatkins.ca/2008/11/29/python-2-and-3-metaclasses/#using-the-metaclass-in-python-2-x


is this an embedded copy of pyyaml? if so please use the packaged
version, it supports both python 2 and 3.


Reply to: