Re: ISO library ref in printed form

2009-07-08 Thread João Valverde
kj wrote: Does anyone know where I can buy the Python library reference in printed form? (I'd rather not print the whole 1200+-page tome myself.) I'm interested in both/either 2.6 and 3.0. TIA! kj Why not download the documentation, take it to a local copy shop and have it printed and

Re: No trees in the stdlib?

2009-07-01 Thread João Valverde
Lawrence D'Oliveiro wrote: In message mailman.2140.1245996088.8015.python-l...@python.org, João Valverde wrote: Simple example usage case: Insert string into data structure in sorted order if it doesn't exist, else retrieve it. the_set = set( ... ) if str in the_set

Re: No trees in the stdlib?

2009-06-29 Thread João Valverde
João Valverde wrote: Paul Rubin wrote: João Valverde backu...@netcabo.pt writes: Interesting, thanks. The concept is not difficult to understand but I'm not sure it would be preferable. A copy operation should have the same cost as a snapshot, You mean a deep-copy

Re: No trees in the stdlib?

2009-06-29 Thread João Valverde
alex23 wrote: João Valverde backu...@netcabo.pt wrote: Currently I don't have a strong need for this. And clearly neither has anyone else, hence the absence from the stdlib. As others have pointed out, there are alternative approaches, and plenty of recipes on ActiveState, which seem

Re: No trees in the stdlib?

2009-06-28 Thread João Valverde
Paul Rubin wrote: a...@pythoncraft.com (Aahz) writes: (In particular, WRT the bisect module, although insertion and deletion are O(N), the constant factor for doing a simple memory move at C speed swamps bytecode until N gets very large -- and we already have collections.deque() for some

Re: No trees in the stdlib?

2009-06-28 Thread João Valverde
Paul Rubin wrote: João Valverde backu...@netcabo.pt writes: Could you clarify what you mean by immutable? As in... not mutable? As in without supporting insertions and deletions? Correct. That's has the same performance as using binary search on a sorted list. What's

Re: No trees in the stdlib?

2009-06-28 Thread João Valverde
João Valverde wrote: Paul Rubin wrote: João Valverde backu...@netcabo.pt writes: Could you clarify what you mean by immutable? As in... not mutable? As in without supporting insertions and deletions? Correct. That's has the same performance as using binary search on a sorted list

Re: No trees in the stdlib?

2009-06-27 Thread João Valverde
João Valverde wrote: Aahz wrote: In article mailman.2170.1246042676.8015.python-l...@python.org, =?ISO-8859-1?Q?Jo=E3o_Valverde?= backu...@netcabo.pt wrote: Anyway, I'm *not* trying to discourage you, just explain some of the roadblocks to acceptance that likely are why it hasn't already

Re: No trees in the stdlib?

2009-06-27 Thread João Valverde
Miles Kaufmann wrote: João Valverde wrote: To answer the question of what I need the BSTs for, without getting into too many boring details it is to merge and sort IP blocklists, that is, large datasets of ranges in the form of (IP address, IP address, string). Originally I was also

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Aahz wrote: In article mailman.2139.1245994218.8015.python-l...@python.org, Tom Reed tomree...@gmail.com wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission considering the

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Aahz wrote: In article mailman.2139.1245994218.8015.python-l...@python.org, Tom Reed tomree...@gmail.com wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Aahz wrote: In article mailman.2139.1245994218.8015.python-l...@python.org, Tom Reed tomree...@gmail.com wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Aahz wrote: In article mailman.2139.1245994218.8015.python-l...@python.org, Tom Reed tomree...@gmail.com wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like a glaring omission

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Jason Scheirer wrote: On Jun 25, 10:32 pm, a...@pythoncraft.com (Aahz) wrote: In article mailman.2139.1245994218.8015.python-l...@python.org, Tom Reed tomree...@gmail.com wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Stefan Behnel wrote: João Valverde wrote: Besides some interface glitches, like returning None on delete if I recall correctly. That's actually not /that/ uncommon. Operations that change an object are not (side-effect free) functions, so it's just purity if they do not have a return

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: Stefan Behnel wrote: João Valverde wrote: Besides some interface glitches, like returning None on delete if I recall correctly. That's actually not /that/ uncommon. Operations that change an object are not (side-effect free) functions, so it's just purity

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: João Valverde wrote: Aahz wrote: In article mailman.2139.1245994218.8015.python-l...@python.org, Tom Reed tomree...@gmail.com wrote: Why no trees in the standard library, if not as a built in? I searched the archive but couldn't find a relevant discussion. Seems like

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Aahz wrote: In article 006078f0$0$9721$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Hash tables (dicts) are useful for many of the same things that trees are useful for, but they are different data structures with different strengths and

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
greg wrote: João Valverde wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). Careful here -- you can't get away from the need for hashability just by using a tree. Even if you don't need

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
João Valverde wrote: greg wrote: João Valverde wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). Careful here -- you can't get away from the need for hashability just by using a tree

Re: No trees in the stdlib?

2009-06-26 Thread João Valverde
Aahz wrote: In article mailman.2170.1246042676.8015.python-l...@python.org, =?ISO-8859-1?Q?Jo=E3o_Valverde?= backu...@netcabo.pt wrote: What's lacking is an associative array that preserves ordering, doesn't require a hash function and has fast insertions and deletions in O(log(n)). The