This is a second version of PEP 567.
A few things have changed:
1. I now have a reference implementation:
https://github.com/python/cpython/pull/5027
2. The C API was updated to match the implementation.
3. The get_context() function was renamed to copy_context() to better
reflect what it is
FWIW the same problem was discussed a year ago when documenting typing. At
that time the discussion was not conclusive,
so that some types use class:: directive while other use data:: directive.
At that time Guido was in favour of data:: and now in view of
PEP 560 many types in typing will stop
Okay, if there is no further feedback, I will work on a
singledispatchmethod decorator like partialmethod.
For the future perhaps, would it not be possible to tell that the passed
argument is a descriptor/function and dispatch to the correct
implementation, thus not needing two functions for
On Wed, 27 Dec 2017 17:28:41 +0100
Antoine Pitrou wrote:
> On Wed, 27 Dec 2017 14:19:16 +
> Jonathan Underwood wrote:
> > Hello,
> >
> > I am not sure if this is expected behaviour, or a bug.
> >
> > In a C extension module, if I create
In his review of PR#4911, Antoine points to the documentation of two type
definitions in importlib.resources, Package and Resource.
https://github.com/python/cpython/pull/4911/files#diff-2a479c407f7177f3d7cb876f244e47bcR804
One question is what markup to use for type definitions. I’m using
On Wed, 27 Dec 2017 14:19:16 +
Jonathan Underwood wrote:
> Hello,
>
> I am not sure if this is expected behaviour, or a bug.
>
> In a C extension module, if I create and return an empty bytes object like
> this:
>
> val = PyBytes_FromStringAndSize (NULL,
Hello,
I am not sure if this is expected behaviour, or a bug.
In a C extension module, if I create and return an empty bytes object like this:
val = PyBytes_FromStringAndSize (NULL, 20);
Py_SIZE(val) = 0;
Then from the Python interpreter's perspective:
isinstance(val, bytes)