Alexandre Vassalotti schrieb:
>> Indexing
>>
>>
>> **Open Issue:** I'm undecided on whether indexing bytes and buffer
>> objects should return small ints (like the bytes type in 3.0a1, and
>> like lists or array.array('B')), or bytes/buffer objects of length 1
>> (like the str type). The
On 9/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> [PEP 3137]
> > > **Open Issue:** I'm undecided on whether indexing bytes and buffer
> > > objects should return small ints (like the bytes type in 3.0a1, and
> > > like lists or array.array('B')), or bytes/buffer objects of length 1
> > > (l
On 9/26/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
>
> > However there's quite a bit of Python 2.x code around that manipulates
> > *bytes* in the guise of 8-bit strings, and it uses tests like "if s[0]
> > == 'x': ..." frequently. This can of course be rewritten using a
>
On 9/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> ...
> Indexing
>
>
> **Open Issue:** I'm undecided on whether indexing bytes and buffer
> objects should return small ints (like the bytes type in 3.0a1, and
> like lists or array.array('B')), or bytes/buffer objects of length 1
> (
Guido van Rossum wrote:
> However there's quite a bit of Python 2.x code around that manipulates
> *bytes* in the guise of 8-bit strings, and it uses tests like "if s[0]
> == 'x': ..." frequently. This can of course be rewritten using a
> slice, but not so easily when you're looping over bytes:
>
Guido van Rossum wrote:
> I'm still undecided (despite Marcin's eloquent argument for ints as
> bytes) but I'm open for votes for this case.
Whatever is done, please don't do it *only* to make
conversion from 2.x easy. There should be good
independent reasons for whatever is chosen.
--
Greg Ewin
On 9/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>
> Constructors
>
>
> There are four forms of constructors, applicable to both bytes and
> buffer:
>
> - ``bytes()``, ``bytes()``, ``buffer()``,
> ``buffer()``: simple copying constructors, with the note
> that ``bytes(
On 9/26/07, Jason Orendorff <[EMAIL PROTECTED]> wrote:
> One situation where a sorteddict would win is finding upper and lower
> bounds. This especially matters if you want to iterate over a
> specific range of keys: "show me all entries between 1 Jan 2007 and 1
> Feb 2007" is O(N) in the number o
[PEP 3137]
> > **Open Issue:** I'm undecided on whether indexing bytes and buffer
> > objects should return small ints (like the bytes type in 3.0a1, and
> > like lists or array.array('B')), or bytes/buffer objects of length 1
> > (like the str type). The latter (str-like) approach will ease porti
I find this semi-convincing. It would be very convincing in a
greenfield situation I think.
However there's quite a bit of Python 2.x code around that manipulates
*bytes* in the guise of 8-bit strings, and it uses tests like "if s[0]
== 'x': ..." frequently. This can of course be rewritten using a
On 9/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> Please comment.
>
> PEP: 3137
> Title: Immutable Bytes and Mutable Buffer
> Version: $Revision: 58264 $
> Last-Modified: $Date: 2007-09-26 14:58:29 -0700 (Wed, 26 Sep 2007) $
> Author: Guido van Rossum <[EMAIL PROTECTED]>
> Status: Draft
> T
Please comment.
PEP: 3137
Title: Immutable Bytes and Mutable Buffer
Version: $Revision: 58264 $
Last-Modified: $Date: 2007-09-26 14:58:29 -0700 (Wed, 26 Sep 2007) $
Author: Guido van Rossum <[EMAIL PROTECTED]>
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 26-Sep-2007
Python
Dnia 25-09-2007, Wt o godzinie 17:22 -0700, Guido van Rossum napisał(a):
> OK. Though it's questionable even whether a slice of a mutable bytes
> object should return a mutable bytes object (as it is not a shared
> view). But as that is what PyBytes currently do it is certainly the
> easiest...
A
[EMAIL PROTECTED] wrote:
> Mark> With sorteddict you pay O(log N) for accessing, but you pay
> Mark> nothing for sorting.
>
> Pay me now or pay me later, but maintaining a sorted sequence will always
> cost something.
>
> Skip
>
Very frequently, however, I want frequent sorted access to
On 9/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 9/21/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> > Guido van Rossum wrote:
> > > """
> > > George isn't tall enough to ride the greatest rollercoaster of all
> > > time, The Turbo Python 3000. He uses licorice whips to measure his
> > > h
One situation where a sorteddict would win is finding upper and lower
bounds. This especially matters if you want to iterate over a
specific range of keys: "show me all entries between 1 Jan 2007 and 1
Feb 2007" is O(N) in the number of entries in that range, not the
entire data set.
I think peop
>> When I program in C++/Qt I use QMap (a sorteddict) very often; the STL
>> equivalent is called map. Both the Qt and STL libraries have dict
>> equivalents (QHash and unordered_map), but my impression is that the
>> sorted data structures are used far more frequently than the unsorted
>> versions
Mark> With sorteddict you pay O(log N) for accessing, but you pay
Mark> nothing for sorting.
Pay me now or pay me later, but maintaining a sorted sequence will always
cost something.
Skip
___
Python-3000 mailing list
Python-3000@python.org
http
Sounds like we need a PEP to sort out the details. I'll try to come up
with something.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-30
On 9/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 9/26/07, Mark Summerfield <[EMAIL PROTECTED]> wrote:
> > Assuming you have a good sorteddict implementation ...
> > you can gain significant performance benefits.
> ... sorted dict implementation, the best performance you can get for
>
On 2007-09-26, Guido van Rossum wrote:
> On 9/26/07, Mark Summerfield <[EMAIL PROTECTED]> wrote:
> > On 2007-09-26, [EMAIL PROTECTED] wrote:
> > > Mark> I have put a new version (incorporating another
> > > implementation Mark> idea from Paul Hankin) on PyPI:
> > >
> > > Mark> http://pypi.p
On 9/26/07, Mark Summerfield <[EMAIL PROTECTED]> wrote:
> On 2007-09-26, [EMAIL PROTECTED] wrote:
> > Mark> I have put a new version (incorporating another implementation
> > Mark> idea from Paul Hankin) on PyPI:
> >
> > Mark> http://pypi.python.org/pypi/sorteddict
> >
> > From that:
>
On 2007-09-26, [EMAIL PROTECTED] wrote:
> Mark> I have put a new version (incorporating another implementation
> Mark> idea from Paul Hankin) on PyPI:
>
> Mark> http://pypi.python.org/pypi/sorteddict
>
> From that:
>
> The main benefit of sorteddicts is that you never have to explic
Mark> I have put a new version (incorporating another implementation
Mark> idea from Paul Hankin) on PyPI:
Mark> http://pypi.python.org/pypi/sorteddict
>From that:
The main benefit of sorteddicts is that you never have to explicitly
sort.
Surely there must be something more
On 2007-09-26, Mike Klaas wrote:
> On 25-Sep-07, at 2:01 PM, Mark Summerfield wrote:
> > On 2007-09-25, Guido wrote:
> >> For that to happen, someone has to write a production-quality
> >> implementation, release it as a separate 3rd party module for a
> >> while,
> >> show that it is sufficiently
25 matches
Mail list logo