Larry Hastings added the comment:

> The "e" variants (typically) allocate a buffer for you, since it's pretty
> much unknown how long the encoded data will be.

All four will do it if you pass in a NULL pointer.  "es#" and "et#" can reuse
an existing buffer, because you can also pass in its size.

> So I guess the "e" descriptions need to have the additional * removed
> or the paragraph has to be updated and all other listings need
> to be converted to precise types (that would be my preference).

Here's the problem with removing the "additional *".  The first argument
to encoding is a static string.  You literally pass in the char * string,
not a pointer to a variable containing the address of the string.  e.g.

  PyArg_ParseTuple("es", args, "utf-8", &buffer);

So how do we annotate that?  [char, char *]?

> I wonder why no one has noticed in all these years.

Because nobody ever freaking uses the "e" format units.  But by golly
I'm going to see that the docs are right and Clinic supports them
correctly--or die trying.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23980>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to