Skip to content

Conversation

@Daetalus
Copy link
Contributor

@Daetalus Daetalus commented Jul 1, 2017

In Python 2, the bool object is essentially an int object. In Python 3, it is long object. This PR subclass the bool object from long instead of the int. Preparing for removing the int object completely.

@Daetalus
Copy link
Contributor Author

Daetalus commented Jul 3, 2017

@kmod

bool_cls->tp_mro = BoxedTuple::create({ bool_cls, int_cls, object_cls });
complex_cls->tp_mro = BoxedTuple::create({ complex_cls, object_cls });
long_cls->tp_mro = BoxedTuple::create({ long_cls, object_cls });
bool_cls->tp_mro = BoxedTuple::create({ bool_cls, int_cls, object_cls });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to update this to be long_cls instead of int_cls.

@kmod
Copy link
Collaborator

kmod commented Jul 8, 2017

Looks awesome! Let's get a small test file set up, something like this:

long_ = type(1L)
assert isinstance(True, long_)
assert issubclass(bool, long_)
print(bool.__bases__)

Daetalus added 6 commits July 12, 2017 03:57
In Python 2, the bool object just a int object. In Python 3, the bool object become long object. So change the bool object to the subclass of long object, prepare for other Python 3 updates.
If any tests ready to python 3, we need to add 'py3ready' flag in the beginning of the file
cmake 2 can not build target Ninja.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants