[Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]
Jim Jewett
jimjjewett at gmail.com
Wed Feb 15 01:39:54 CET 2006
More information about the Python-Dev mailing list
Wed Feb 15 01:39:54 CET 2006
- Previous message: [Python-Dev] bytes type discussion
- Next message: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2/14/06, Neil Schemenauer <nas at arctrix.com> wrote:
> People could spell it bytes(s.encode('latin-1')) in order to make it
> work in 2.X.
Guido wrote:
> At the cost of an extra copying step.
That sounds like an implementation issue. If it is important
enough to matter, then why not just add some smarts to the
bytes constructor?
If the argument is a str, and the constructor owns the only
reference, then go ahead and use the argument's own
underlying array; the string itself will be deallocated when
(or before) the constructor returns, so no one else can use
it expecting an immutable.
-jJ
- Previous message: [Python-Dev] bytes type discussion
- Next message: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list