On Feb 7, 5:23 am, Terry Reedy wrote:
> John Machin wrote:
> > The UTF-n siblings are *external* representations.
> > 2.x: a_unicode_object.decode('UTF-16') -> an_str_object
> > 3.x: an_str_object.decode('UTF-16') -> a_bytes_object
>
> That should be .encode() to bytes, which is the coded form.
>
John Machin wrote:
The UTF-n siblings are *external* representations.
2.x: a_unicode_object.decode('UTF-16') -> an_str_object
3.x: an_str_object.decode('UTF-16') -> a_bytes_object
That should be .encode() to bytes, which is the coded form.
.decode is bytes => str/unicode
--
http://mail.python
"John Machin" wrote:
>By the way, has anyone come up with a name for the shifting effect
>observed above on str, and also with repr, range, and the iter*
>family? If not, I suggest that the language's association with the
>best of English humour be widened so that it be dubbed the "Mad
>Hatter's
John Machin wrote:
> On Feb 6, 9:24 pm, Chris Rebert wrote:
>> On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan
>>
>> wrote:
>>
>>> Hi,
>>> Excuse me if this is a repeat question!
>>> I just wanted to know how are strings represented in python?
>>> I need to know in terms of:
>>> a) String
On Feb 6, 9:24 pm, Chris Rebert wrote:
> On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan
>
> wrote:
>
> > Hi,
>
> > Excuse me if this is a repeat question!
>
> > I just wanted to know how are strings represented in python?
>
> > I need to know in terms of:
>
> > a) Strings are stored as UT
Hi,
Kalyankumar Ramaseshan wrote:
Hi,
Excuse me if this is a repeat question!
I just wanted to know how are strings represented in python?
It depents on if you mean python2.x or python3.x - the model
changed.
Python 2.x knows str and unicode - the former a sequence
of single byte character
On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan
wrote:
>
> Hi,
>
> Excuse me if this is a repeat question!
>
> I just wanted to know how are strings represented in python?
>
> I need to know in terms of:
>
> a) Strings are stored as UTF-16 (LE/BE) or UTF-32 characters?
IIRC, Depends on wha