[Python-Dev] cpython: asyncio: Fix CoroWrapper (fix my previous commit) (original) (raw)

Guido van Rossum guido at python.org
Thu Jan 16 20:03:46 CET 2014


Yeah the confusing thing is that omitting the docstring fixes it -- the class still has a doc attribute but apparently it comes from the metaclass. :-)

I guess you could have both a class and an instance doc by making a really clever descriptor, but it seems simpler to just use a comment instead of a docstring. :-)

I'll do this now.

On Thu, Jan 16, 2014 at 8:14 AM, Christian Heimes <christian at python.org> wrote:

On 16.01.2014 16:57, Guido van Rossum wrote:

Because somehow you can't have a slot named doc and a docstring in the class. Try it. (I tried to work around this but didn't get very far.) That's true for all class attributes. You can't have a slot and a class attribute at the same time. After all the doc string is stored in a class attribute, too.

class Example: ... slots = ("egg",) ... # This doesn't work ... egg = None ... Traceback (most recent call last): File "", line 1, in ValueError: 'egg' in slots conflicts with class variable

class Example: ... """doc""" ... slots = ("doc",) ... Traceback (most recent call last): File "", line 1, in ValueError: 'doc' in slots conflicts with class variable


Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org

-- --Guido van Rossum (python.org/~guido)



More information about the Python-Dev mailing list