-
Notifications
You must be signed in to change notification settings - Fork 167
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
PR: Again! Disambiguate rope.base.ast and stdlib.ast #587
Conversation
As discussed before, the "fuzziness" between stdlib's If If it is important to you that you see the difference, another idea is maybe you can write a syntax highlighter for your editor that would color objects from Linters often complain about about
Republishing modules like this is a very common pattern in Python, so there should have been ways to tell tools that you know what you're doing. Even the stdlib's |
Not all wrappers are a good idea.
Huh? Why would anyone want to color different python files differently? Leo gives users many options for coloring different languages differently (see below) but that's a different matter entirely. Leo's wrappers Leo uses Leo supports syntax coloring with both QSyntaxHighlighter and pygments. Leo's core doesn't know which highlighter the user has chosen. Leo's leo.core.leoColorizer module masks (wraps) several colorizers. Converted jEdit description files drive the Lastly, Leo can run on multiple Guis, including PyQt5, PyQt6, npyscreen, and flexx. Leo's core doesn't know what Gui is running. Several wrapper/interface modules hide all the details. Summary I have lots of experience using wrappers. Imo, wrapping
|
@lieryan I feel frustrated and thwarted by our lack of agreement on this PR and PR #614. I would be sad to part company with Rope, but without these PRs I would have no other choice:
Please accept this PR. I can do no more significant work on Rope without it. |
That is no different than what But we still need Currently, part of this version specific details are scattered about in the rope code; some in patchedast, some used to be in the pycompat that we had just removed, some in other places, etc. But |
I really don't understand what you're trying to get at by "playing games with imports".
There is supposed to be no differences between stdlib's If we had written visitor classes from scratch, then there shouldn't be a need for |
I couldn't disagree more. The docstring for """
General import wrapper for PyQt5 and PyQt6.
Provides the *PyQt6* spellings of Qt modules, classes, enums and constants:
- QtWidgets, not QtGui, for all widget classes.
- QtGui, not QtWidgets, for all other classes in the *PyQt4* QtGui module.
- QtWebKitWidgets, not QtWebKit.
- Enums: KeyboardModifier, not KeyboardModifiers, etc.
""" The Without this wrapper, all clients of
|
I would be happy to remove In my experience, seemingly small cleanups like removing |
@lieryan I'll soon start work on another PR, say I am going away for the Holidays this Wednesday. I'll be gone for about one week. I might not be able to work on In short, I would welcome merging this PR into master, but that's not essential at present. |
See Issue #570 for previous discussions.
This PR disambiguates rope.base.ast and stdlib.ast with small, easily understood, diffs.
rope.base.ast
torope.base.rast
.from ast import *
from rast.py.rast
only to accessrast.parse
,rast.call_for_nodes
, and classrast.RopeNodeVisitor(ast.NodeVisitor)
import ast
statements as needed.ast
qualifier toliteral_eval
.module_imports
, temporarily mark a dubious comment with###
.Advantages
stdlib.ast
and which names come from
rope.base.rast
.rope.base.ast
.For example,
rope.base.ast.iter_child_nodes
actually meansast.iter_child_nodes
!This mistake was another legacy of
from ast import *
.rast.parse
fromast.parse
.stdlib.ast
should that ever become desirable.from ast import *
helps all checker tools.Note: Several of these advantages became clear only after looking at the diffs!
Note: It took longer to write this comment than it did to change the code.