Tim Peters wrote:
[Ruslan Spivak]
I'd like to implement 'setdefault' method for BTrees. For me it seems
like lacking feature of mapping protocol. It can be of course easily
emulated, but "Readability counts."(C) :)
If there won't be objections regarding this method then i'll try to make
this e
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tim Peters wrote:
> [Tim]
>
>>>...
>>>It's tricky to implement this in a way that scales efficiently to
>>>a "large number" of hooks. I assume that's not a problem, because
>>>the current implementation doesn't scale efficiently either (it's
>>>quadr
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tim Peters wrote:
> [Tim]
>
>>...
>>Julien provided links to code that already uses the new feature:
>>
>>""" As an Indexation Manager :
>>http://svn.nuxeo.org/trac/pub/file/CPSCore/trunk/IndexationManager.py
>>
>>As an Event Manager :
>>http://svn.nu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jim Fulton wrote:
> Tim Peters wrote:
>
>> [Tim]
>>
>>> ...
>>> Julien provided links to code that already uses the new feature:
>>>
>>> """ As an Indexation Manager :
>>> http://svn.nuxeo.org/trac/pub/file/CPSCore/trunk/IndexationManager.py
>>>
>>> A
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dieter Maurer wrote:
> Tim Peters wrote at 2005-8-22 16:48 -0400:
>
>>...
>>Jim still wonders, and he got me wondering too, whether the `order=` gimmick
>>is really needed.
>
>
> But, it is a very easy concept -- both easy to grasp as well as easy
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jim Fulton wrote:
> Dieter Maurer wrote:
>
>> Tim Peters wrote at 2005-8-22 16:48 -0400:
>>
>>> ...
>>> Jim still wonders, and he got me wondering too, whether the `order=`
>>> gimmick
>>> is really needed.
>>
>>
>>
>> But, it is a very easy concept -
Just back from vacation...
Jeremy Hylton wrote:
On 8/22/05, Tim Peters <[EMAIL PROTECTED]> wrote:
Jim still wonders, and he got me wondering too, whether the `order=` gimmick
is really needed. For example, you could have gotten to the same end here
with the old method, by registering your ac
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jeremy Hylton wrote:
> On 8/22/05, Tim Peters <[EMAIL PROTECTED]> wrote:
>
>>Jim still wonders, and he got me wondering too, whether the `order=` gimmick
>>is really needed. For example, you could have gotten to the same end here
>>with the old metho
Dieter Maurer wrote:
Tim Peters wrote at 2005-8-26 14:59 -0400:
...
Doing
obj._p_changed = True
when obj is a ghost appears to be senseless (what could a user possibly
intend by doing this?)
I met this strange behaviour and considered it a bug.
What I wanted to do: use a ZODB obje
I'm trying to straighten out the new BTree.setdefault() code, on
ZODB/branches/alienoid-btrees_setdefault.
Turns out this can't work like Python's dict.setdefault() in all cases.
This is why:
>>> d = {}
>>> d.setdefault(666)
>>> d
{666: None}
That is, the default for the optional ``default`` arg
[Tim Peters]
> ...
> Proposal: make BTree/Bucket setdefault() a two-argument function (3 if
> you count ``self`` too). In practice, an explicit default is always
> passed, and not even in theory could we come up with a sane
> default-default that works across all tree types.
This has been done o
"Tim Peters" <[EMAIL PROTECTED]> writes:
> I'm trying to straighten out the new BTree.setdefault() code, on
> ZODB/branches/alienoid-btrees_setdefault.
>
> Turns out this can't work like Python's dict.setdefault() in all cases.
> This is why:
>
d = {}
d.setdefault(666)
d
> {666: Non
"Tim Peters" <[EMAIL PROTECTED]> writes:
> [Tim Peters]
>> ...
>> Proposal: make BTree/Bucket setdefault() a two-argument function (3 if
>> you count ``self`` too). In practice, an explicit default is always
>> passed, and not even in theory could we come up with a sane
>> default-default that w
[Tim]
>> ...
>> Nothing else to do, so in the absence of objections I'll merge this to
>> ZODB trunk tomorrow.
[Ruslan]
> Oh, you already did that, cool! Thanks, no objections from my side :)
In that case, none from my side either ;-)
___
For more info
[Tim Peters]
>> I'm trying to straighten out the new BTree.setdefault() code, on
>> ZODB/branches/alienoid-btrees_setdefault.
>>
>> Turns out this can't work like Python's dict.setdefault() in all cases.
>> This is why:
>>
>> >>> d = {}
>> >>> d.setdefault(666)
>> >>> d
>> {666: None}
[Ruslan Spiv
Hello all,
I want to do the following: commit a change to an object, then commit
another. Now I want to undo the second change. Easy: get the tid using
undoLog and call undo(tid, transaction.get()). Now the following
transactions are in the DB:
- Change 1
- Change 2
- Undo change 2
Now I want t
16 matches
Mail list logo