Re: [Python-Dev] Py_ssize_t formatting

2006-05-14 Thread Thomas Wouters
On 5/14/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: Georg Brandl wrote:>> Right. At least, not with changing structmember.[ch].>> Did you mean "without"?Oops, right.> Can I submit a patch?I personally don't mind having more types added to structmember, so I'm +0 on adding Py_ssize_t to the lis

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Martin v. Löwis
Georg Brandl wrote: >> Right. At least, not with changing structmember.[ch]. > > Did you mean "without"? Oops, right. > Can I submit a patch? I personally don't mind having more types added to structmember, so I'm +0 on adding Py_ssize_t to the list of types supported. I wonder what the specif

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Tim Peters
[Neal] >> Looking in stringobject.c, I don't see how %zu (or %lu) can be used >> with String_FromFormatV. [Martin] > Right. It currently cannot be used. So if it is desired, it needs to > be added first, and then should be used. I added it: %u, %lu, and %zu can be used now in PyString_FromFormat

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Martin v. Löwis
Neal Norwitz wrote: >> That's a bug. It should print it signed. If unsigned printing of size_t >> is desired, %zu should be used. > > Looking in stringobject.c, I don't see how %zu (or %lu) can be used > with String_FromFormatV. Right. It currently cannot be used. So if it is desired, it needs to

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Neal Norwitz
On 5/13/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > '%zd' won't work since my value can be negative, and the 'z' modifier > > converts the argument to size_t. > > That's a bug. It should print it signed. If unsigned printing of size_t > is desired, %zu should be used. Looking in stringo

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Georg Brandl
Martin v. Löwis wrote: > Georg Brandl wrote: >> Similary, there's no way for a structmember to be of type Py_ssize_t... > > Right. At least, not with changing structmember.[ch]. Did you mean "without"? Can I submit a patch? Georg ___ Python-Dev mailin

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Martin v. Löwis
Georg Brandl wrote: > Similary, there's no way for a structmember to be of type Py_ssize_t... Right. At least, not with changing structmember.[ch]. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Georg Brandl
Martin v. Löwis wrote: > Georg Brandl wrote: >> which formatting code should be used for a Py_ssize_t value in e.g. >> PyString_FromFormat? > > %zd > >> '%zd' won't work since my value can be negative, and the 'z' modifier >> converts the argument to size_t. > > That's a bug. It should print it

Re: [Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Martin v. Löwis
Georg Brandl wrote: > which formatting code should be used for a Py_ssize_t value in e.g. > PyString_FromFormat? %zd > '%zd' won't work since my value can be negative, and the 'z' modifier > converts the argument to size_t. That's a bug. It should print it signed. If unsigned printing of size_t

[Python-Dev] Py_ssize_t formatting

2006-05-13 Thread Georg Brandl
Hi, which formatting code should be used for a Py_ssize_t value in e.g. PyString_FromFormat? '%zd' won't work since my value can be negative, and the 'z' modifier converts the argument to size_t. Georg ___ Python-Dev mailing list Python-Dev@python.org