-
-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 preparation: Change names of some function attributes #15983
Comments
Commit: |
New commits:
|
Branch: u/wluebbe/ticket/15983 |
comment:3
maybe you also have to correct the names inside the 'hasattr' ? |
comment:4
Yes, seems suspicious. I will look into it. |
comment:5
From the Python docs (http://docs.python.org/2/reference/datamodel.html): //Changed in version 2.6: The double-underscore attributes !closure!, !code!, !defaults!, and !globals! were introduced as aliases for the corresponding func_* attributes for forwards compatibility with Python 3.// !dict!, !doc! and !name! were already available earlier. Looking at the code with Would you agree? |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
The modules with hasattr() might still benefit from some refactoring, as the code could now be a bit simplified. But I leave this for later ... |
comment:9
looks good, I have checked that every instance was found and corrected. But one needs to make sure that nothing is broken and that all tests pass.. |
comment:10
doctests fail in
|
comment:11
Actually this looks like a bug fix -- the previous version wouldn't work on Python functions/methods defined in Cython code (well they really just duck-type Python functions), since Cython doesn't include the The doctests just need updating to reflect the bug fix. |
comment:12
Actually, nevermind. This is supposed to be stripped, but there are now two instances of this line information, and only one is getting stripped. I should have a patch soon to fix it. It seems that the 'func_doc' was being used to separate cython functions from python functions. |
comment:13
Ok, I believe this should be a fix for the issue, for now. New commits:
|
Changed branch from u/wluebbe/ticket/15983 to u/ohanar/remove_func_star |
Changed branch from u/ohanar/remove_func_star to u/wluebbe/ticket/15983 |
comment:14
I did a rebase on develop to test with a fresh 6.2.beta6.
My questions (as still being pretty new to Sage):
New commits:
|
comment:15
author/reviewer names please |
Reviewer: Frédéric Chapoton, R. Andrew Ohana |
Author: Wilfried Luebbe, R. Andrew Ohana |
comment:17
Replying to @wluebbe:
In general, you should probably merge in the latest beta rather than rebase (this is a change from how sage use to do things to match standard git practices). That said, extra merges are unnecessary, so you should try to avoid making merges unless there is a merge conflict or an issue is only popping up on a more recent version of sage.
Yes, although part of a review is to look at the changes in the code and make sure you agree with them.
Use |
comment:18
Thanks for the explanation! Next time I will try a merge when there is a merge conflict. |
Changed branch from u/wluebbe/ticket/15983 to |
Only the modern syntax like
f.__doc__
is accepted by Python 3.Changes according to
lib2to3/fixes/fix_funcattrs.py
:This ticket is tracked as a dependency of meta-ticket ticket:15980.
CC: @fchapoton
Component: distribution
Author: Wilfried Luebbe, R. Andrew Ohana
Branch/Commit:
c03d421
Reviewer: Frédéric Chapoton, R. Andrew Ohana
Issue created by migration from https://trac.sagemath.org/ticket/15983
The text was updated successfully, but these errors were encountered: