Hi,
I'm trying to package spades[1] and found the following code inside an
__init__.py file:
...
class YAMLObjectMetaclass(type):
The metaclass for YAMLObject.
def __init__(cls, name, bases, kwds):
super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds)
if
On Feb 13, 2014, at 05:37 PM, Andreas Tille wrote:
File /usr/share/spades/pyyaml3/__init__.py, line 284
class YAMLObject(metaclass=YAMLObjectMetaclass):
This is Python 3 syntax for specifying a metaclass. Maybe this is somehow
getting executed by Python 2?
There are ways to make
On Thu, Feb 13, 2014 at 5:37 PM, Andreas Tille andr...@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):
On Thu, 13 Feb 2014, Andreas Tille wrote:
which ends up in
File /usr/share/spades/pyyaml3/__init__.py, line 284
class YAMLObject(metaclass=YAMLObjectMetaclass):
that is the python3 way to say
class YAMLObject:
__metaclass__ = YAMLObjectMetaclass
in python2
--
Yaroslav O.
[Andreas Tille, 2014-02-13]
I'm trying to package spades[1] and found the following code inside an
__init__.py file:
...
class YAMLObjectMetaclass(type):
The metaclass for YAMLObject.
def __init__(cls, name, bases, kwds):
super(YAMLObjectMetaclass,
* Andreas Tille andr...@an3as.eu [140213 17:39]:
File /usr/share/spades/pyyaml3/__init__.py, line 284
class YAMLObject(metaclass=YAMLObjectMetaclass):
Hi Andreas,
A class's metaclass is not the same as a base class. It's way to
control how objects are created. The best explanation of
This is a python3 syntax change; in python3 you can pass an optional
metaclass for a class, which you can't do in python2, IIRC.
Code works for me in Python3, not python 2.7.6
regards
Al
On 13/02/2014 16:37, Andreas Tille wrote:
class YAMLObjectMetaclass(type):
The metaclass for
On Feb 11, 2014, at 01:49 PM, Michael Hall wrote:
I am a python developer with a large focus on webapps (Django
specifically), as well as a long history of working on Ubuntu webapp
projects. I recently started to contribute to the debian-newmaint
project, and am working on packaging the Django
8 matches
Mail list logo