From: timo verbeek on 27 May 2010 07:16 what is the problem with this code? _base={"repeat":False,"string":"Progres has failed","works":True} print _base class dictreturn(_base):pass this error Traceback (most recent call last): File "<string>", line 244, in run_nodebug File "C:\Documents and Settings\Owner\Desktop\Python\assistent new \user\dictreturn.py", line 4, in <module> class dictreturn(_base):pass TypeError: Error when calling the metaclass bases
From: Chris Rebert on 27 May 2010 07:22 On Thu, May 27, 2010 at 4:16 AM, timo verbeek <timoverbeek10(a)gmail.com> wrote: > what is the problem with this code? > > _base={"repeat":False,"string":"Progres has failed","works":True} > print _base > class dictreturn(_base):pass You can't subclass a dictionary object, you can only subclass other classes. What on earth are you trying to do? Cheers, Chris -- http://blog.rebertia.com
|
Pages: 1 Prev: Fastest way to apply a function to an iterable Next: if, continuation and indentation |