This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author joydiamond
Recipients joydiamond
Date 2018-10-29.00:16:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1540772185.07.0.788709270274.issue35098@psf.upfronthosting.co.za>
In-reply-to
Content
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 == 'green'

Color.__new__ = 0
del Color.__new__

red = Color('red')      #   Fails in Python 3; works in Python 2 & pypy
assert red.name == 'red'

This works in Python 2, pypy, but fails in Python 3 as follows:

Traceback (most recent call last):
  File "x.py", line 13, in <module>
    red = Color('red')      #   Fails in Python 3; works in Python 2 & pypy
TypeError: object() takes no parameters
History
Date User Action Args
2018-10-29 00:16:25joydiamondsetrecipients: + joydiamond
2018-10-29 00:16:25joydiamondsetmessageid: <1540772185.07.0.788709270274.issue35098@psf.upfronthosting.co.za>
2018-10-29 00:16:25joydiamondlinkissue35098 messages
2018-10-29 00:16:24joydiamondcreate