André Malo wrote:
> * Eric Smith wrote:
>> But now that I look at time.strftime in py3k, it's converting the entire
>> unicode string to a char string with PyUnicode_AsString, then converting
>> back with PyUnicode_Decode.
>
> Looks wrong to me, too... :-)
>
> nd
I don't understand Unicode encod
* Eric Smith wrote:
> André Malo wrote:
> > I guess, a clean and complete solution (besides re-implementing the
> > whole thing) would be to resolve each single format character with
> > strftime, decode according to the locale and re-assemble the result
> > string piece by piece. Doh!
>
> That's
André Malo wrote:
> I guess, a clean and complete solution (besides re-implementing the whole
> thing) would be to resolve each single format character with strftime,
> decode according to the locale and re-assemble the result string piece by
> piece. Doh!
That's along the lines of what I was
* Nick Coghlan wrote:
> Eric Smith wrote:
> > The bad error message is a result of __format__ passing on unicode to
> > strftime.
> >
> > There are, of course, various ugly ways to work around this involving
> > nested format calls.
>
> I don't know if this fits your definition of "ugly workaround
Eric Smith wrote:
> The bad error message is a result of __format__ passing on unicode to
> strftime.
>
> There are, of course, various ugly ways to work around this involving
> nested format calls.
I don't know if this fits your definition of "ugly workaround", but what
if datetime.__format__
Eric Smith wrote:
>> Guido van Rossum wrote:
>>> For data types whose output uses only ASCII, would it be acceptable if
>>> they always returned an 8-bit string and left it up to the caller to
>>> convert it to Unicode? This would apply to all numeric types. (The
>>> date/time types have a strftime
Steve Holden wrote:
> Nick Coghlan wrote:
>> To elaborate on this a bit (and handwaving a lot of important details
>> out of the way) do you mean something like the following for the builtin
>> format?:
>>
>> def format(obj, fmt_spec=None):
>> if fmt_spec is None: fmt_spec=''
>> result
Nick Coghlan wrote:
> Guido van Rossum wrote:
>> For data types whose output uses only ASCII, would it be acceptable if
>> they always returned an 8-bit string and left it up to the caller to
>> convert it to Unicode? This would apply to all numeric types. (The
>> date/time types have a strftime()
Nick Coghlan wrote:
> Guido van Rossum wrote:
>> For data types whose output uses only ASCII, would it be acceptable if
>> they always returned an 8-bit string and left it up to the caller to
>> convert it to Unicode? This would apply to all numeric types. (The
>> date/time types have a strftime()
Guido van Rossum wrote:
> For data types whose output uses only ASCII, would it be acceptable if
> they always returned an 8-bit string and left it up to the caller to
> convert it to Unicode? This would apply to all numeric types. (The
> date/time types have a strftime() style API which means the
Guido van Rossum wrote:
> On Jan 10, 2008 9:57 AM, Eric Smith <[EMAIL PROTECTED]> wrote:
>> Eric Smith wrote:
>>> 1: How should the builtin format() work? It takes 2 parameters, an
>>> object o and a string s, and returns o.__format__(s). If s is None, it
>>> returns o.__format__(empty_string).
On Jan 10, 2008 9:57 AM, Eric Smith <[EMAIL PROTECTED]> wrote:
> Eric Smith wrote:
> > (I'm posting to python-dev, because this isn't strictly 3.0 related.
> > Hopefully most people read it in addition to python-3000).
> >
> > I'm working on backporting the changes I made for PEP 3101 (Advanced
> >
Eric Smith wrote:
> (I'm posting to python-dev, because this isn't strictly 3.0 related.
> Hopefully most people read it in addition to python-3000).
>
> I'm working on backporting the changes I made for PEP 3101 (Advanced
> String Formatting) to the trunk, in order to meet the pre-PyCon release
>
M.-A. Lemburg wrote:
> On 2008-01-10 14:31, Eric Smith wrote:
>> (I'm posting to python-dev, because this isn't strictly 3.0 related.
>> Hopefully most people read it in addition to python-3000).
>>
>> I'm working on backporting the changes I made for PEP 3101 (Advanced
>> String Formatting) to the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Jan 10, 2008, at 9:07 AM, M.-A. Lemburg wrote:
> On 2008-01-10 14:31, Eric Smith wrote:
>> (I'm posting to python-dev, because this isn't strictly 3.0 related.
>> Hopefully most people read it in addition to python-3000).
>>
>> I'm working on backp
On 2008-01-10 14:31, Eric Smith wrote:
> (I'm posting to python-dev, because this isn't strictly 3.0 related.
> Hopefully most people read it in addition to python-3000).
>
> I'm working on backporting the changes I made for PEP 3101 (Advanced
> String Formatting) to the trunk, in order to meet th
16 matches
Mail list logo