Hi everyone,
Take a look at this question:
http://stackoverflow.com/questions/16122435/python-3-how-do-i-use-bytes-to-bytes-and-string-to-string-encodings/16122472?noredirect=1#comment23034787_16122472
Is there really no way to use base64 that's as short as:
b'whatever'.encode('base64')
Hi,
Your question is discussed since 4 years in the following issue:
http://bugs.python.org/issue7475
The last proposition is to add transform() and untransform() methods
to bytes and str types. But nobody implemented the idea. If I remember
correctly, the missing point is how to define which
if two lines is cumbersome, you're in for a cumbersome life a programmer.
On Apr 22, 2013 7:31 AM, Ram Rachum r...@rachum.com wrote:
Hi everyone,
Take a look at this question:
On 22 April 2013 12:39, Calvin Spealman ironfro...@gmail.com wrote:
if two lines is cumbersome, you're in for a cumbersome life a programmer.
One of which is essentially Python's equivalent of a declaration...
Paul
___
Python-Dev mailing list
On Mon, Apr 22, 2013 at 7:39 AM, Calvin Spealman ironfro...@gmail.com wrote:
if two lines is cumbersome, you're in for a cumbersome life a programmer.
Other encodings are either missing completely from the stdlib, or have
corrupted behavior. For example, string_escape is gone, and
unicode_escape
On Mon, Apr 22, 2013 at 09:50:14AM -0400, Devin Jeanpierre
jeanpierr...@gmail.com wrote:
unicode_escape doesn't make any sense anymore -- python code is text,
not bytes, so why does 'abc'.encode('unicode_escape') return bytes?
AFAIU the situation is simple: unicode.encode(encoding) returns
Devin Jeanpierre writes:
why does 'abc'.encode('unicode_escape') return bytes?
Duck-typing: encode always turns unicode into bytes.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
On Mon, 22 Apr 2013 09:50:14 -0400, Devin Jeanpierre jeanpierr...@gmail.com
wrote:
On Mon, Apr 22, 2013 at 7:39 AM, Calvin Spealman ironfro...@gmail.com wrote:
if two lines is cumbersome, you're in for a cumbersome life a programmer.
Other encodings are either missing completely from the
On 22.04.13 15:52, eli.bendersky wrote:
http://hg.python.org/cpython/rev/c9674421d78e
changeset: 83494:c9674421d78e
user:Eli Bendersky eli...@gmail.com
date:Mon Apr 22 05:52:16 2013 -0700
summary:
Simplify the code of get_attrib_from_keywords somewhat.
-
On Mon, Apr 22, 2013 at 10:13 AM, Serhiy Storchaka storch...@gmail.comwrote:
On 22.04.13 15:52, eli.bendersky wrote:
http://hg.python.org/cpython/**rev/c9674421d78ehttp://hg.python.org/cpython/rev/c9674421d78e
changeset: 83494:c9674421d78e
user:Eli Bendersky eli...@gmail.com
date:
Victor Stinner wrote:
The last proposition is to add transform() and untransform() methods
to bytes and str types. ... If I remember
correctly, the missing point is how to define which types are
supported by a codec
Also, for any given codec, which direction is transform
and which is
On Tue, 23 Apr 2013 11:16:20 +1200, Greg Ewing greg.ew...@canterbury.ac.nz
wrote:
Victor Stinner wrote:
The last proposition is to add transform() and untransform() methods
to bytes and str types. ... If I remember
correctly, the missing point is how to define which types are
supported
--Guido van Rossum (sent from Android phone)
On Apr 22, 2013 6:09 PM, R. David Murray rdmur...@bitdance.com wrote:
On Tue, 23 Apr 2013 11:16:20 +1200, Greg Ewing
greg.ew...@canterbury.ac.nz wrote:
Victor Stinner wrote:
The last proposition is to add transform() and untransform() methods
On 23/04/13 09:16, Greg Ewing wrote:
Victor Stinner wrote:
The last proposition is to add transform() and untransform() methods
to bytes and str types. ... If I remember
correctly, the missing point is how to define which types are
supported by a codec
Also, for any given codec, which
On Apr 22, 2013, at 10:04 PM, Steven D'Aprano st...@pearwood.info wrote:
On 23/04/13 09:16, Greg Ewing wrote:
Victor Stinner wrote:
The last proposition is to add transform() and untransform() methods
to bytes and str types. ... If I remember
correctly, the missing point is how to define
On Mon, Apr 22, 2013 at 7:04 PM, Steven D'Aprano st...@pearwood.info wrote:
As others have pointed out in the past, repeatedly, the codec system is
completely general and can transform bytes-bytes and text-text just as
easily as bytes-text. Or indeed any bijection, as the docs for 2.7 point
On Tue, Apr 23, 2013 at 4:04 AM, Steven D'Aprano st...@pearwood.info wrote:
As others have pointed out in the past, repeatedly, the codec system is
completely general and can transform bytes-bytes and text-text just as
easily as bytes-text.
Yes, but the encode()/decode() methods are not, and
Using decode() and encode() would break that predictability. But someone
suggested the use of transform() and untransform() instead. That would
clarify that the transformation is bytes bytes and Unicode string
Unicode string.
On 23 Apr 2013 05:50, Lennart Regebro rege...@gmail.com wrote:
On
18 matches
Mail list logo