New submission from Joy Diamond :
Fix the following in https://www.python.org/dev/peps/pep-3115/
REPLACE:
"""
def __new__(cls, name, bases, classdict):
# Note that we replace the classdict with a regular
# dict before passing it to the supercl
Joy Diamond added the comment:
Documented here:
https://docs.python.org/3/library/stdtypes.html#class.__subclasses__
(Though does not appear in google searches)
--
stage: -> resolved
status: open -> closed
___
Python tracker
New submission from Joy Diamond :
Add documentation for `type.__subclasses__` to docs.python.org
Python ideas discussion:
https://mail.python.org/pipermail/python-ideas/2018-October/054361.html
--
assignee: docs@python
components: Documentation
messages: 328848
nosy: docs@python
Joy Diamond added the comment:
Its quite valid to assign to __new__ to replace the behavior of how an instance
is created.
(Obviously you would not really assign `0` to it; my example was just to show
the `del Color.__new__` fails - so what was assigned was not relevant).
Here is a more
New submission from Joy Diamond :
Related: https://bugs.python.org/issue5322
Consider the following program:
class Color(object):
__slots__ = (('name',))
def __init__(self, name):
self.name = name
green = Color('green') # Works
assert green.name ==
New submission from Joy Diamond :
This is a request to fix the documentation for __instancecheck__.
Please add the following:
"""
(Note that any object `x` is always considered to be an instance of
`type(x)`, and this cannot be overridden.)
"""
Consider the fo