[Shedskin-list] *ERROR* formal arguments of method must start with 'self'
Status: Alpha
Brought to you by:
mdufour
From: Jeff H. - DM&T <je...@du...> - 2008-01-14 02:03:41
|
class mpnumeric(object): """Base class for mpf and mpc. Calling mpnumeric(x) returns an mpf if x can be converted to an mpf (if it is a float, int, mpf, ...), and an mpc if x is complex.""" def __new__(cls, val): # TODO: should maybe normalize here if isinstance(val, cls): return val if isinstance(val, complex): return mpc(val) return mpf(val) Beyond the standard naming convention for meta classes, where "cls" is used in place of "self" is there something about metaclasses that shedskin would not like by design? Or could the requirements for formal arguments be expanded in shedskin to include "cls" in addition to "self" ?? I realize I can just change cls to self and make the ss compiler happy for that method, but am I going in a direction that isn't appropriate for ss? -- Jeff Hinrichs Dundee Media & Technology, Inc je...@du... 402.218.1473 |