Builtn super() function. How to use it with multiple inheritance? And why should I use it at all? Hi! I have two super classes: class SuperClass1(object): def __init__(self, word): print word class SuperClass2(object): def __init__(self, word, word2): print word, word2 Also I have subclass of these classes: class SubClass(SuperClass1, SuperClass2): def __init__(self):... 2 Aug 2010 02:45
'as' keyword - when/how to use it I am having the hardest time trying to find documentation on proper use of the 'as' keyword (aside from . I initially thought that I would be allowed to do something such as: import shared.util as util The as statement seems to be causing a lot of ''module' object has no attribute'. Is it safe to assume that t... 24 Jul 2010 16:40
understanding the mro (long) TL;DR: if you want to stay sane, don't inherit two classes that share same inheritance graph I recently got puzzled by a bug from a legacy lib (ClientForm) which have this code: class ParseError(sgmllib.SGMLParseError, HTMLParser.HTMLParseError, ): pass ... 24 Jul 2010 15:34
Socket performance Hey Everyone, I had a question, programming sockets, what are the things that would degrade performance and what steps could help in a performance boost? I would also appreciate being pointed to some formal documentation or article. I am new to this. Warm regards, Nav ... 25 Jul 2010 09:43
non-blocking IO EAGAIN on write On Fri, 23 Jul 2010 10:45:32 +0200, Thomas Guettler wrote: I use non-blocking io to check for timeouts. Sometimes I get EAGAIN (Resource temporarily unavailable) on write(). My working code looks like this. But I am unsure how many bytes have been written to the pipe if I get an EAGAIN IOError. It shou... 27 Jul 2010 02:59
Light-weight/very-simple version control under Windows using Python? I have some very simple use cases[1] for adding some version control capabilities to a product I'm working on. My product uses simple, text (UTF-8) based scripts that are independent of one another. I would like to "version control" these scripts on behalf of my users. By version control, I mean *very-simple* versi... 25 Jul 2010 21:38
A portable LISP interpreter that includes all the major list-processing functions is described. A complete, annotated listing of the program's code, written in PASCAL, is included. Title Portable LISP interpreter Creator/Author Cox, L.A. Jr. ; Taylor, W.P. Publication Date 1978 May 31 OSTI Identifier OSTI ID: 7017786 Report Number(s) UCRL-52417 DOE Contract Number W-7405-ENG-48 Resource Type Technical Report Research Org California Univ., Livermore (USA). Lawrence Livermore Lab. Subje... 5 Aug 2010 13:32
Function closure inconsistency I was playing around with Python functions returning functions and the scope rules for variables, and encountered this weird behavior that I can't figure out. Why does f1() leave x unbound, but f2() does not? def f1(): x = 0 def g(): x += 1 return x return g1 def f2(): x... 23 Jul 2010 19:07
time between now and the next 2:30 am? How can I calculate how much time is between now and the next 2:30 am? Naturally I want the system to worry about leap years, etc. Thanks, Jim ... 24 Jul 2010 08:00
Unicode error I am having some problems with unicode from json. This is the error I get UnicodeEncodeError: 'ascii' codec can't encode character u'\x93' in position 61: ordinal not in range(128) I have kind of developped this but obviously it's not nice, any better ideas? try: text=texts[i] ... 7 Aug 2010 11:28 |