Opened 5 years ago

Closed 5 years ago

#15986 closed enhancement (fixed)

Python 3 preparation: Change names of some method attributes

Reported by: wluebbe Owned by:
Priority: major Milestone: sage-6.2
Component: distribution Keywords: python3
Cc: Merged in:
Authors: Wilfried Luebbe Reviewers: R. Andrew Ohana
Report Upstream: N/A Work issues:
Branch: addb5a6 (Commits) Commit: addb5a6a75e926deadf1a80209ce39de0d9ca940
Dependencies: Stopgaps:

Description

Only the modern syntax like method.__func__ is accepted by Python 3.

Changes according to lib2to3/fixes/fix_methodattrs.py:

method.im_? -> method.__?__
for
('im_func' | 'im_self' | 'im_class')

This ticket is tracked as a dependency of meta-ticket ticket:15980.

Change History (8)

comment:1 Changed 5 years ago by wluebbe

For additional information from http://docs.python.org/2/reference/datamodel.html#index-39

Changed in version 2.6: For Python 3 forward-compatibility, im_func is also available as __func__, and im_self as __self__.

comment:2 Changed 5 years ago by wluebbe

  • Branch set to u/wluebbe/ticket/15986
  • Commit set to a9713ece0aee6b025da14e9e3dafdf97ef73e7e0
  • Status changed from new to needs_review

8 modules were changed. Only the case "im_func -> __func__" was found.

One occurrence in sage/structure/element.pyx had already been handled in ticket:15983.


New commits:

a9713ecchanged to new method attribute names (im_func -> __func__)

comment:3 Changed 5 years ago by wluebbe

  • Status changed from needs_review to needs_work

needs work since automerging failed

comment:4 Changed 5 years ago by git

  • Commit changed from a9713ece0aee6b025da14e9e3dafdf97ef73e7e0 to addb5a6a75e926deadf1a80209ce39de0d9ca940

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

addb5a6changed to new method attribute names (im_func -> __func__)

comment:5 Changed 5 years ago by wluebbe

Resolved automerge conflict by rebasing on 6.2.beta5.

1 file was already fixed in 6.2.beta5. So only 7 files remain.

comment:6 Changed 5 years ago by wluebbe

  • Status changed from needs_work to needs_review

I did

git merge u/chapoton/15991 u/wluebbe/ticket/15986 u/wluebbe/ticket/15987

on top of u/wluebbe/ticket/15992 (which is rebased on 6.2.beta5)

Test report:

./sage -t -p --all --long --logfile=logs/ptestlong-alle4.log
...
All tests passed!

comment:7 Changed 5 years ago by ohanar

  • Authors set to Wilfried Luebbe
  • Reviewers set to R. Andrew Ohana
  • Status changed from needs_review to positive_review

Looks good.

comment:8 Changed 5 years ago by vbraun

  • Branch changed from u/wluebbe/ticket/15986 to addb5a6a75e926deadf1a80209ce39de0d9ca940
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.