[Python-Dev] cpython: Issue #16129: Add `Py_SetStandardStreamEncoding`

Antoine Pitrou solipsis at pitrou.net
Fri Oct 18 12:28:53 CEST 2013


Le Fri, 18 Oct 2013 20:16:03 +1000,
Nick Coghlan <ncoghlan at gmail.com> a écrit :
> >
> > Also, shouldn't it be excluded from the stable/limited API?
> 
> Since it didn't expose any struct layouts, I just followed the
> precedent set by the other PySet_* APIs on that front. Moving it
> would be fine, too, though, since "embedding the interpreter" and
> "using the limited API" don't exactly mix :)

As far as I understand, when we *add* something to the stable ABI, it
should ideally be versioned. There are a couple examples of this in the
include files, e.g.:

  #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
  /* New in 3.3 */
  PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*);
  PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*);
  #endif

(this is so people wanting to conform to e.g. a 3.2-compatible ABI
don't start depending on 3.3-and-upwards stuff by mistake)

However, it seems we haven't been following that rule, for the most
part.

Regards

Antoine.




More information about the Python-Dev mailing list