On Mar 18, 2005, at 02:15, Kent Johnson wrote:
Max Noel wrote:
#!/usr/bin/env python
import math
import timeit
def primeConcise(limit):
return [2] + [x for x in xrange(3, limit, 2) if not [y for y in
[2] + range(3,x,2) if x%y==0]]
def primeConciseOptimized(limit):
return [2] + [x for x in
Gregor Lingl a écrit :
Hi!
Who knows a more concise or equally concise but more efficient
expression, which returns the same result as
[x for x in range(2,100) if not [y for y in range(2,x) if x%y==0]]
Gregor
P.S.: ... or a more beautiful one ;-)
___
Hi
How can I initialize a class like this from a file:
class Some:
def __init__(self,data,axis,**kwargs):
pass
'data' and 'axis' should be lists of floats. Meta data can be passed to
kwargs like 'name=name,date=2/3/05,...'.
Right now the return value of my function reading
Brian van den Broek wrote:
Kent Johnson said unto the world upon 2005-03-17 20:44:
The multiple inheritance from MyNode and Toolkit.NodeX is a smell. I
guess you do this because you want to override methods of Toolkit.Node
as well as Toolkit.NodeX, or add methods to both MyNode1 and MyNode2?
I
Christian Meesters wrote:
Hi
How can I initialize a class like this from a file:
class Some:
def __init__(self,data,axis,**kwargs):
pass
'data' and 'axis' should be lists of floats. Meta data can be passed to
kwargs like 'name=name,date=2/3/05,...'.
Right now the return value of my
On 03/18/2005-10:35AM, Mike Hall wrote:
A caret as the first charachter in a class is a negation.
So this [^\s]+ means match one or more of any char that
isn't whitespace.
Ok, so the context of metas change within a class. That makes sense,
but I'm unclear on the
On Mar 18, 2005, at 1:02 PM, Christopher Weimann wrote:
On 03/18/2005-10:35AM, Mike Hall wrote:
A caret as the first charachter in a class is a negation.
So this [^\s]+ means match one or more of any char that
isn't whitespace.
Ok, so the context of metas change within a class. That makes sense,
Hi all of you!
Many thanks for your remarks, ideas and experiments.
When I posted my input yesterday:
[x for x in range(2,100) if not [y for y in range(2,x) if x%y==0]]
my intention was indeed to find a shortest a program, disregarding
efficiency. Thus range instead of xrange etc.
(About one year
Hi Danny!
Preliminary remark: I know that beautiful and beauty
are concepts very seldom applied to computer programs or
programming languages. I suppose mainly because they are
to a large extent a matter of taste ...
Nevertheless: regardeless of the fact that I'm not a very
skilled
Concerning my previous posting - perhaps it
would suffice to summarize:
While Python is a language for the pragmatic lover,
Scheme is much more fundamentalistic.
(thought-) *PROVOKING*?
Gregor
___
Tutor maillist - Tutor@python.org
Gregor Lingl said unto the world upon 2005-03-18 19:57:
Hi Danny!
Preliminary remark: I know that beautiful and beauty
are concepts very seldom applied to computer programs or
programming languages. I suppose mainly because they are
to a large extent a matter of taste ...
Hi Gregor and all,
Though
11 matches
Mail list logo