jects
Since nobody else has mentioned it, I'd point you at Mock objects:
http://python-mock.sourceforge.net/
for another way to skin the cat that it sounds like has been
biting you. They are surprisingly useful for exploratory
and regression testing.
--Scott David Daniels
scott.dani...@acm.o
e I don't think control characters are likely in the interpreter
file name.
You could work around this by creating a symlink (or even hard link to
the python executable named "python\r"
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
in
order to make equal immutable values identical, you'd
have to end each operation producing an immutable result
with a search of all appropriately typed values for one
that was equal.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
.6.4? Does your test work in 2.6?
Also consider how 2to3 translates the problem section(s).
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ven a data structure with backlinks.
Regards,
-- Scott
--
http://mail.python.org/mailman/listinfo/python-list
ed to wind up with r being [[1, 2, 3], [1, 2, 999], [1, 2, 3]].
What's the right way to construct r as a list of *independent* d lists?
Thanks,
-- Scott
--
http://mail.python.org/mailman/listinfo/python-list
these are numbers:
a, b = [x.__add__ for x in [1, 2]]
print a(10)
print b(10)
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
aqs/smart-questions.html
Hint: I don't know your CPU, python version, IDLE version, matplotlib
version, nor do you provide a small code example that allows me to
easily reproduce your problem (or not).
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ion _very_ soon) -- get to python dev immediately if
you have problems with the release candidate.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
George Trojan wrote:
Scott David Daniels wrote:
...
And if you are unsure of the name to use:
>>> import unicodedata
>>> unicodedata.name(u'\xb0')
'DEGREE SIGN'
> Thanks for all suggestions. It took me a while to find out how to
> configure my ke
gt;>> q = s.decode('utf-8')
>>> degrees, rest = q.split(u'\N{DEGREE SIGN}')
>>> print degrees
48
>>> print rest
13' 16.80" N
And if you are unsure of the name to use:
>>> import unicodedata
>>> unicodedata.name(u'\xb0')
'DEGREE SIGN'
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
l you what locations are being checked for files.
Normally you should:
1) tell us python version and which OS (and OS version) you are using.
2) include a pasted copy of exactly what did not work, along with the
resulting output, and why you did not expect the output you got.
--
On Oct 10, 6:44 pm, Dave Angel wrote:
> Scott Grant wrote:
> > On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote:
>
> >> Scott Grant schrieb:
>
> >>> Hi there,
>
> >>> I'd like to set up a framework in which I can add or remove new
On Oct 10, 2:42 pm, "Diez B. Roggisch" wrote:
> Scott Grant schrieb:
>
>
>
> > Hi there,
>
> > I'd like to set up a framework in which I can add or remove new
> > classes of a given expected subclass to my package, and have the
> > system
uld be
great to be able to add or remove these player strategies as new ones
come in, but I don't want to add a bunch of overhead importing each
one specifically in the game manager itself.
Thanks for your time,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
art making real money from it, like ActiveState you'll help out
the community that is giving you its support.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
Scott David Daniels wrote: ...
class Initialized(ClassBase):
@classmethod
def _init_class(class_):
class_.a, class_.b = 1, 2
super(Initialized, class_)._init_class()
Mea culpa: Here super is _not_ a good idea,
[…]
Why is ‘super
her than looping in the way you might in C for example, the
numpy where might be quicker if you have a big image. Just a
thought...
And a good thought too...
I think what Martin is telling you is:
Look to numpy to continue working on the array first.
byte_store = imgL.astype(np.uint8)
I
Scott David Daniels wrote:
...
Look into metaclasses:
...
class Initialized(ClassBase):
@classmethod
def _init_class(class_):
class_.a, class_.b = 1, 2
super(Initialized, class_)._init_class()
Mea culpa: Here super is _not_ a good idea, and I had
tialized.a, Initialized.b
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 5, 6:05 pm, MRAB wrote:
> Scott wrote:
> > I create a list of logs called LogList. Here is a sample:
>
> > LogList =
> > ["inbound tcp office 192.168.0.125 inside 10.1.0.91 88",
> > "inbound tcp office 192.168.0.220 inside 10.1.0.31 2967",
I create a list of logs called LogList. Here is a sample:
LogList =
["inbound tcp office 192.168.0.125 inside 10.1.0.91 88",
"inbound tcp office 192.168.0.220 inside 10.1.0.31 2967",
"inbound udp lab 172.24.0.110 inside 10.1.0.6 161",
"inbound udp office 192.168.0.220 inside 10.1.0.13 53"]
I want
make the easy path the fast path, and more will use it;
provide two ways, and the first that springs to mind is the one
used.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
candide wrote:
Hi
I was wondering if there exists somme way to clear memory of all objects
created during a current IDLE session (with the same effect as if one
starts an IDLE session). Thanks.
Different than "Shell / Restart Shell (Ctrl+F6)" ?
Of course this doesn't work if you started Idle i
d out the efficiency reason (asking the machine
to do a pile of work that you intend to throw away). But nobody
warned you:
s.rsplit(None, 1)[-1]
would be better in the case of 'single_word'.rsplit(None, 1)
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/
On Sep 28, 2:00 pm, Dave Angel wrote:
> Scott wrote:
> > Thank you fine folks for getting back with your answers!
>
> > So down the road I do dictname[line42].append("new stuff"). (or [var]
> > if I'm looping through the dict)
>
> Nope, you still haven
> That should actually be dictname["line42"].append("new stuff"). Notice
> the quotes around line42.
>
> Good luck! Python is a fine language, I hope you like it.
>
> ~Ethan~
Doh. I sent it before my type, fail, fix cycle had taken place.
Got it.
Thanks again all!
--
http://mail.python.org/mai
Thank you fine folks for getting back with your answers!
So down the road I do dictname[line42].append("new stuff"). (or [var]
if I'm looping through the dict)
This is cool and should do the trick!
-Scott Freemire
disclosure - Ok, I'm new to *any* language. I've been te
I am new to Python but I have studied hard and written a fairly big
(to me) script/program. I have solved all of my problems by Googling
but this one has got me stumped.
I want to check a string for a substring and if it exists I want to
create a new, empty list using that substring as the name of
class__.needs_initial = False
def setUp(self):
if self.needs_initial:
self.initialize()
And write your test classes like:
class Bump(FunkyTestCase):
def initialize(self):
super(Bump, self).initialize()
print 'One time
etdefault = mutating(dict.setdefault)
update = mutating(dict.update)
d = SerializedDictionary(whatever)
Then just use dict.serial to see if there has been a change.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
lly request
Unicode via __unicode__, if it exists.
Even more fun (until you know what is going on):
>>> c = C()
>>> "%s %s %s" % (c, u'c', c)
u'[str] c [unicode]'
--Scott David Daniels
Scott David dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
.
The number including denormals and -0.0 is 2 ** 64 - 2 ** 53.
There are approx. 2 ** 53 NaNs (half with the sign bit on).
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ou make of Mixin and MyMixin inherit from object you get:
CommonBase.method_x(BaseA.18613328, 0, '', '0x0')
BaseA
...
CommonBase.method_x(FooZ.18480592, 7, '---', '0x5b')
MyMixin FooZ
CommonBase.method_x(BarW.18591280, 8, '', '0x68')
BaseA Mixin BarW
...
Note that in the BarW case (with object), not all mixins are called.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Button(subframe, text='<',
command=partial(output, c2 + '->' + c1)).pack()
subframe.pack(fill='x', expand=1)
...
Also note from Pep 8, spaces are cheap and make the code easier to read.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
cifically, by a
NEWLINE token)?
I don't know what your actual requirement is but maybe this fits:
exec("print '%s'" % x)
Lots of fun when preceded by:
x = "'; sys.exit(); print 'b"
or far nastier things. Exec is the same level of dangerous a
print 'FooZ'
>>> FooZ().method_x(1,2,3)
MixinBase
BaseC
Mixin
FooZ
>>> FooY().method_x(1,2,3)
MixinBase
Mixin
>>> FooX().method_x(1,2,3)
MixinBase
BaseA
Mixin
FooX
>>> BaseA().method_x(1,2,3)
MixinBase
BaseA
>>>
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
grams this way, you can get another speedup
for frequently used programs. Create a little program consisting of:
import actual_program
actual_program.main()
Your larger program will only be compiled once, and the dinky one
compiles quickly.
--Scott David Daniels
scott.dani...@acm.org
--
http
may contribute to clutter without adding
much information.
An equality operator would be nice as well (don't bother with
ordering though, you get lost in a twisty maze of definitions
all different).
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
n Python we make that, "once __new__ had returned."
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
queue...I thought t.join() would just work.
Why do we need None?
Because your workers aren't finished, they are running trying to get
something more to do out of the queue. The t.join() would cause a
deadlock w/o the None.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.pyth
os((len(parts) * N, len(parts) * N), dtype=float)
for n, chunk in enumerate(parts):
base = n * 3
result[base : base + 3, base : base + 3] = chunk
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Piet van Oostrum wrote:
Scott David Daniels (SDD) wrote:
SDD> James Harris wrote:...
Another option:
0.(2:1011), 0.(8:7621), 0.(16:c26b)
where the three characters "0.(" begin the sequence.
Comments? Improvements?
SDD> I did a little interpreter where non-base 10 num
0 (decimal)
.F.100 == 256 (hexadecimal)
.1.100 == 4 (binary)
.3.100 == 9 (trinary)
.Z.100 == 46656 (base 36)
Advantages:
Tokenizer can recognize chunks easily.
Not visually too confusing,
No issue of what base the base indicator is expressed in.
--Scott David Daniels
there is such a spot, it is a major security weakness.
You'd be able to automate password attacks.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
rsion says, "'2.6.2 (r262:71605, ...'" [don't do dots yourself]
To understand more of why we need this on every question, see:
http://www.mikeash.com/getting_answers.html
or google for "smart questions".
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Never mind -- ditched the attempt and implemented Dijkstra.
--
http://mail.python.org/mailman/listinfo/python-list
I have a list of nodes, and I need to find a path from one node to
another. The nodes each have a list of nodes they are connected to,
set up like this:
class Node(object):
def __init__(self, connectedNodes):
self.connectedNodes = connectedNodes
nodes = {
1: Node
1.194797383466323, 1.1945367358141823]
>>> timeit.Timer("list(Holder(L))", setup % 16).repeat(number=1000)
[2.4244464031043123, 2.4261885239604482, 2.4050011942858589]
vs straight chain.from_iterable (on my machine):
[0.7828263089303249, 0.79326171343005925, 0.80967664884783019]
[1.499
d make the code harder to read. So, no, unittest does not
require that you code things into foo.py. You will find that you
may bend your coding style within foo.py in order to make it more
testable, but (if you do it right) that should also make the code
clearer.
--Scott David Daniels
scot
wo three four':
if getattr(Base, name) is not getattr(Base, name):
raise NotImplementedError(
'%s implementation missing' % name)
...
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
MRAB wrote:
Scott David Daniels wrote:
MRAB wrote:
The shortest I can come up with is:
"[" + "][".join(letters) + "]"
Maybe a golf shot:
"][".join(letters).join("[]")
Even shorter:
"["+"][".join(letters)
explanations:
http://xkcd.com/327/
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
MRAB wrote:
The shortest I can come up with is:
"[" + "][".join(letters) + "]"
Maybe a golf shot:
"][".join(letters).join("[]")
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
e above to:
require(REQUIRE_OFF or s is not None)
//code
ensure(ENSURE_OFF or hasattr(returnValue, '__iter__'))
Python has no good way to turn off argument calculation by
manipulating function definition (at least that I know of).
--Scott David Daniels
scott.dani...@acm.or
ng
the Python code without significantly affecting the the DB work
needed. The "SELECT *" form in the EXIST test is something DB
optimizers look for, so don't fret about wasted data movement.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
flect C's
rules, and I see little excuse for trying to change them now.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
arn yet another language.
It seems nice to me that you can use a rule that says, "stick to
normal names and you don't have to worry about mucking with the
way Python itself works, but if you are curious, looks for those
things and fiddle with them."
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ated.
I must learn this "etc." language, I hear it mentioned all the time :-)
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ong time.
>>> 'a'< 'd' <'z'
True
>>> 'a'< 'D' <'z'
False
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
:
digest = hashlib.sha1(self.keypair.as_der()).hexdigest().upper()
return ':'.join(digest[pos : pos+2] for pos in range(0, 40, 2))
--Scott David Daniels
scott.dani...@acm.org
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
e Python adapter to
the database. DO YOU HAVE A RUNNING PostgreSQL server that you can
connect to?
Just to be a bit more explict:
Change file setup.py's line 219 from:
>> except (Warning, w):
to either (OK in Python 2.6 and greater):
except Warning as w:
or (works for Pyt
s but I'm
curious)
I think it explained in the complex math area, but basically EE types
use j, math types use i for exactly the same thing. Since i is so
frequently and index in CS, and there is another strong convention,
why not let the EE types win?
--Scott David Daniels
scott.dani...@acm
a 5-9
b 7-10
c 3-6
d 15-20
e 18-23
'''
source = iter(sample.split('\n')) # source of lines, opened file?
ignored = source.next() # discard heading
for interval in
hon's, does this work?
import random
random.seed(123542552)
I'm not quite sure how you came to believe that Python controls MySQL,
as opposed to using its services.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Piet van Oostrum wrote:
Scott David Daniels (SDD) wrote:
SDD> Stephen Cuppett (should have written in this order):
"Fred Atkinson" wrote ...
Is there a pre-defined variable that returns the GET line...
os.environment('QUERY_STRING')
SDD> Maybe you mean:
SDD>
andle the grayscale.
.MNG is pictures only, but that doesn't hurt you in the least.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
'QUERY_STRING')
Maybe you mean:
os.environ['USER']
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
The posted regex doesn't work; this might be homework, so
I'll not fix the two problems. The fact that you did not
see the failure weakens your claim of "does so very clearly."
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Piet van Oostrum wrote:
Scott David Daniels (SDD) schreef:
...
SDD> Or even:
SDD> proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE)
SDD> with gzip.open(filename, 'w') as dest:
SDD> for line in iter(proc.stdout, ''
;ls','-la'], stdout=subprocess.PIPE)
with gzip.open(filename, 'w') as dest:
for line in iter(proc.stdout, ''):
f.write(line)
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
following:
C:\> assoc .py=Python26.File
C:\> fumble.py
C:\> assoc .py=Python31.File
C:\> fumble.py
That is the basic idea, but at the moment, I don't see a simple demo
working for me. SO, if you want to pursue this, you can probably get it
to work.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
hence
imagined a woman. I suspect it would come to irk one
almost enough to become a Gabe.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ith py24, py25, py26 can be convenient.
By the way, install Python 3.1 rather than 3.0; think of 3.0 as the
alpha of the 3.X branches (it will get no love at all now that 3.1
is out).
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
haracter operations to be running up and down strings
a character at a time, changing here and there. So it becomes more
natural to deal with strings as chunks to pass around, and it is nice
not to have to copy the strings when doing that passing around.
--Scott David Daniels
scott.dani...@acm.org
x27;ve used it only a little, so I can't vouch for its stability, but it
fits the threading and license requirements (well, some corporate
lawyers have trouble with the LGPL, but I think it's usable).
-- Scott
--
http://mail.python.org/mailman/listinfo/python-list
mport io
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), encoding='utf8')
for line in sys.stdin:
line = line.strip()
if line == '':
#do something here
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ications of bool(x) is ignored here.
If minimizing side-effects is needed:
def xor(a, b):
if a:
if not b:
return a
elif b:
return b
return False
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
you get the duck programming language?
It shares a type system with Python, of course. :-)
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
s to a slightly more general machine than the Aho-Corasick processing
requires.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
#;
And mine is one w/o the base 10 bias:
.f.123 == 0x123
.7.123 == 0o123
.1.1101 == 0b1101
That is, ..
-- show the base by showing base-1 in the base.
I actually built this into "OZ," an interpretter.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailma
then you need
array elements to contain the indices for the children explicitely.
And you loower your locality of reference (cache-friendliness).
Note the insert in Python, for example, is quite cache-friendly.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
ct, it may well be easily
capable of that. If no success, you might contact PJ at Groklaw, she
has dealt with a _lot_ of PDFs (and knows people who deal with PDFs
in bulk).
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
> Your class definition isn't right. It makes 'value' and 'journal'
> class variables (Java lingo: "static variables") as opposed to the
> instance variables they should be. Here's a corrected version:
>
Woah, thanks. I can't believe I made such a stupid mistake. It's not
like I'm a newcomer to Py
> BTW, you should derive all your classes from something. If nothing
> else, use object.
> class textfile(object):
Just out of curiousity... why is that? I've been coding in Python for
a long time, and I never derive my base classes. What's the advantage
to deriving them?
--
http://mail.python
I'm trying to pickle an instance of a class. It mostly works just fine
-- I can save the pickle to a file, restore it from that file, and
it's mostly okay. The problem is, some lists seem to disappear. For
example (snipped and crunched from the code giving me trouble):
---
class InitGame:
ng to your house for a cup of coffee. :-)
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
n the library. So, take the sources and
edit, but change the module name. Even better is figure out how to
use _socket.pyd, to create a smaller _socketexpmodule.c and use that.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
Raymond Hettinger wrote:
[Scott David Daniels]
def most_frequent(arr, N): ...
In Py2.4 and later, see heapq.nlargest().
I should have remembered this one
In Py3.1, see collections.Counter(data).most_common(n)
This one is from Py3.2, I think.
Oops -- egg all
Raymond Hettinger wrote:
[Scott David Daniels]
def most_frequent(arr, N): ...
In Py2.4 and later, see heapq.nlargest().
I should have remembered this one
In Py3.1, see collections.Counter(data).most_common(n)
This one is from Py3.2, I think.
--Scott David Daniels
scott.dani...@acm.org
Steven D'Aprano wrote:
On Fri, 10 Jul 2009 08:28:29 -0700, Scott David Daniels wrote:
Steven D'Aprano wrote:
Even *soup stock* fits the same profile as what Hendrik claims is
almost unique to programming. On its own, soup stock is totally
useless. But you make it, now, so you can y
3
class MyClass(object):
__metaclass__ = MyType
a = 5
print MyClass.a, MyClass.demo
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
needs (and he uses color to distinguish
version-to-version changes).
http://rgruet.free.fr/
Sadly, I no longer work there, so my copy is gone. :-(
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
nwind = []
try:
self.a = Foo('a')
unwind.append(a)
self.b = Foo('b', fail=True)
unwind.append(b)
...
except Exception, why:
while unwind):
unwind.pop().close()
I have been having issues trying to wrap libusb-1.0 with ctypes. Actually,
there's not much of an issue if I keep everything synchronous, but I need
this to be asynchronous and that is where my problem arises.
Please refer to the following link on Stackoverflow for a full overview of
the issue.
h
urn powers
if num < limit:
if num > 1:
# if you really want the factors then append((num, 1))
powers.append(2)
return powers
OK, that's a straightforward speedup, _but_:
factorize(6) == [2, 2] == factorize(10) == fa
Peter Otten wrote:
Scott David Daniels wrote:
Scott David Daniels wrote:
t = timeit.Timer('sum(part[:-1]==part[1:])',
'from __main__ import part')
What happens if you calculate the sum in numpy? Try
t = timeit.Timer('
holds led to making better nails.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
("don't repeat yourself") as a maxim, let
it go the first time and wait until you see the pattern (a possible
function). I'd go with a function first, a pair of functions, and
only then look to abstracting the function.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
... Here's a heuristic replacement for my previous frequency code:
I've tried to mark where you could fudge numbers if the run time
is at all close.
Boy, I cannot let go. I did a bit of a test checking for cost to
calculated number of discovered samples,
401 - 500 of 2115 matches
Mail list logo