Hi all,
Just curious how to get an all bells and whistles debug build of python.
In the source for 2.4.3, I see the following debug related options:
From README:
(1)
e.g. make OPT=-g will build a debugging version of Python
on most platforms
(2)
Additional debugging code to help debug memory
Hello all,
I was curious if anyone has transitioned some code from using Raymond
Hettinger's bag class:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174
to using 2.5's collections.defaultdict. Any pitfalls to watch out for? It
seems we should be able to do slightly better than
Paul McGuire wrote:
Mark E. Fenner [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello all,
snip
Here's my class of the objects being copied:
class Rule(list):
def __init__(self, lhs=None, rhs=None, nClasses=0, nCases=0):
self.nClasses = nClasses
Hello all,
I have a code where my inner loop looks like:
allNew = []
for params in cases:
newObj = copy(initialObject)
newObj.modify(params)
allNew.append(newObj)
return allNew
and the copy is taking the majority (42%) of my execution time.
So, I'd like to speed up my copy. I had
Michael Spencer wrote:
Mark E. Fenner wrote:
and the copy is taking the majority (42%) of my execution time.
So, I'd like to speed up my copy. I had an explicit copy method that did
what was needed and returned a new object, but this was quite a bit
slower than using the standard lib
John Machin wrote:
Mark E. Fenner wrote:
Here's my class of the objects being copied:
Here's a couple of things that might help speed up your __init__
method, and hence your copy method:
class Rule(list):
def __init__(self, lhs=None, rhs=None, nClasses=0, nCases=0):
def
Mark E. Fenner wrote:
John Machin wrote:
Mark E. Fenner wrote:
Here's my class of the objects being copied:
Here's a couple of things that might help speed up your __init__
method, and hence your copy method:
class Rule(list):
def __init__(self, lhs=None, rhs=None, nClasses
danielx wrote:
Mark E. Fenner wrote:
Mark E. Fenner wrote:
John Machin wrote:
Mark E. Fenner wrote:
Here's my class of the objects being copied:
Here's a couple of things that might help speed up your __init__
method, and hence your copy method:
class Rule(list
Without researching it, I would guess that you have to override __new__
so as not to pass through the myName arg to the otherwise inherited and
called-with-all-arguments __new__ of the base class.
snip
Regards,
Bengt Richter
Bengt,
Thanks as always! Python's rabbit holes always go a
Hello all,
I was migrating some code from sets.ImmutableSet to frozenset and noticed
the following:
**code
#!/usr/bin/env python
from sets import ImmutableSet
class MSet1(ImmutableSet):
def __init__(self, iterArg, myName=foo):
ImmutableSet.__init__(self, iterArg)
In the code below, the class DifferentCache utilizes three different
memoization (caching) strategies. Neither the function Memoize1 or
the class Memoize2 will be adequate for all three of these cases (I
intend these to be used as, for example,
getInstanceValueFunction =
11 matches
Mail list logo