Hi All,
Is anything wrong with the following code?
class Superclass(object):
def __new__(cls):
# Questioning the statement below
return super(Superclass, cls).__new__(Subclass)
class Subclass(Superclass):
pass
if __name__ == '__main__':
instance = Superclass()
print instance
It
Hi All,
I tried looking in several places, including Python's documentation,
CheeseShop, general search, and didn't find anything. Is implementation
of GNU date input formats
(http://www.gnu.org/software/tar/manual/html_node/tar_109.html)
available in Python? I'm primarily interested in parsing
I think I like generator comprehension in this case better than either
list comprehension or a filter because both of the latter create a new
full result list before the loop even begins. At least I suppose they
do. Also, I think Mitja's suggestion if not test: continue and
Terry's filter function
Hi All,
I apologize if this was brought up before, I couldn't find any prior
art :-).
On more than one occasion, I found myself wanting to use a conditional
loop like this (with Invalid syntax error, of course):
for i in c if test:
print i*2
...because it's similar to
Thank you for replying, Mitja! That *is* a nice alternative.
Do you think it's a good idea to ask on comp.python.devel if they would
be interested in a PEP about this (provided there is none)?
Cheers,
Sergey.
--
http://mail.python.org/mailman/listinfo/python-list
Why not combine the two:
I guess because (at least in source code) you're doing a loop twice
:-). I don't know what a compiler would do. I think though that the
for i in c if test: construct is more readable and maybe can even be
better optimized.
Thanks!
Sergey.
--