[PATCH] D67882: [LNT] Python 3 support: make leaf classes inherit from object

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 07:37:44 PDT 2019


thopre marked 2 inline comments as done.
thopre added a comment.

In D67882#1697371 <https://reviews.llvm.org/D67882#1697371>, @hubert.reinterpretcast wrote:

> Perhaps others are more well-versed in this than I am, but I think that having a link in the commit message and using the terminology used by the documentation ("new-style" and "classic") would be useful here: https://docs.python.org/2/reference/datamodel.html#newstyle. Also, I am not sure that switching these to be new-style classes in Python 2 is necessary. I believe the commit message should give additional rationale, e.g., using new-style classes helps make the Python 2 and Python 3 behaviour of the code more similar.


Good point about terminology. I'm not sure I understand your point about it not being necessary in Python 2. All the changes I'm doing in this Python 3 support series are not necessary for Python 2, they are here to have a codebase that works accross both versions of Python.

In D67882#1697371 <https://reviews.llvm.org/D67882#1697371>, @hubert.reinterpretcast wrote:

> Perhaps others are more well-versed in this than I am, but I think that having a link in the commit message and using the terminology used by the documentation ("new-style" and "classic") would be useful here: https://docs.python.org/2/reference/datamodel.html#newstyle. Also, I am not sure that switching these to be new-style classes in Python 2 is necessary. I believe the commit message should give additional rationale, e.g., using new-style classes helps make the Python 2 and Python 3 behaviour of the code more similar.


I hadn't realized that the explicit inheritance from object was not a requirement of Python 3. Therefore as you say it's only to improve behaviour being more similar between Python 2 and 3 but given the timeframe and the low amount of commits on LNT I don't think that is necessary. I think we should make LNT Python 3 only as soon as it can work in that mode, so the less compability code we can add the better. Do you agree with that approach?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67882/new/

https://reviews.llvm.org/D67882





More information about the llvm-commits mailing list