Re: In an inherited class, "embedded" classes is referenced?

2007-12-21 Thread Christian Joergensen
tion - but referenced it :) > Your workaround might be implementable using a metaclass in a more > conveinient way, but I'm not sure-footed enough with metaclasses to > provide a solution out of my head now. That would be fun ;-) -- Christian Joergensen | Linux, programming or web consult

Re: In an inherited class, "embedded" classes is referenced?

2007-12-21 Thread Christian Joergensen
in clsdict.iteritems(): > if isinstance(value,type): > clsdict[key] = type(value.__name__,(value,),{}) > type.__new__(cls,name,bases,clsdict) > > > class A(object): > __metaclasS__ = AutoSubclassMetaclass > class C(object): &

In an inherited class, "embedded" classes is referenced?

2007-12-19 Thread Christian Joergensen
"C", (object,), {'foobar': 60}) Instead of: >>> B.C.foobar = 60 Thanks, -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: Python FTP server down

2007-03-04 Thread Christian Joergensen
r workstation and scp/sftp it to the remote server. -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: Superclass for Errors?

2006-12-27 Thread Christian Joergensen
ributeError, etc. See http://rgruet.free.fr/PQR25/PQR2.5.html#BuiltInExc I would guess you're looking for StandardError. -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: finding the list of the matched strings

2006-11-05 Thread Christian Joergensen
s such a function. I would have written it using a list comprehension. >>> import re >>> ll = ('a', 'b', 's1', 's2', '3s') >>> p = re.compile('^s.*') >>> newList = [s for s in ll if p.match(s)] >>> newList ['s1', 's2'] -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a commas-in-between idiom?

2006-11-05 Thread Christian Joergensen
6] >>> print ','.join(map(str, list)) 1,2,3,4,5,6 -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot import a module from a variable

2006-10-15 Thread Christian Joergensen
mportError: No module named i > > But it seems that import donot know what is i ? why? Try using __import__(i) instead. -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info -- http://mail.python.org/mailman/listinfo/python-list