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)
> 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.
> Regards,
> Bengt Richter
Bengt,
Thanks as always! Python's rabbit holes always go a lit
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 = Memoize1(getInstanceValue
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 an
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 q
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):
>> de
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 me
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:
>> >
Paul McGuire wrote:
> "Mark E. Fenner" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Hello all,
>>
>
>>
>> Here's my class of the objects being copied:
>>
>> class Rule(list):
>> def __init__(s
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 cr
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 memo
11 matches
Mail list logo