This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Python 3 support: import object when inheriting from it
AbandonedPublic

Authored by thopre on Sep 21 2019, 10:21 AM.

Details

Summary

Import object from builtins for existing inheritance from object. This
was produced by running futurize's stage2 libfuturize.fixes.fix_object.

Event Timeline

thopre created this revision.Sep 21 2019, 10:21 AM

My understanding is that this patch has no effect for Python 3. In Python 2, object from builtins (as provided by the future package) is used to enable use of some Python 3 coding patterns. Absent further changes that make use of such enablement, I am not sure that this patch is necessary. If this patch is needed to support later patches, then I suggest applying the fixer at that point. Applying the fixer before applying D67882 seems odd anyway.

thopre abandoned this revision.Oct 7 2019, 7:59 AM

My understanding is that this patch has no effect for Python 3. In Python 2, object from builtins (as provided by the future package) is used to enable use of some Python 3 coding patterns. Absent further changes that make use of such enablement, I am not sure that this patch is necessary. If this patch is needed to support later patches, then I suggest applying the fixer at that point. Applying the fixer before applying D67882 seems odd anyway.

I wholly agree (see what I wrote in D67882). And yes the ordering in which futurize do these changes is odd.