Skip to content

PR: Use single inheritance for Rope's object classes#675

Closed
edreamleo wants to merge 3 commits intopython-rope:masterfrom
edreamleo:ekr-single-inheritence
Closed

PR: Use single inheritance for Rope's object classes#675
edreamleo wants to merge 3 commits intopython-rope:masterfrom
edreamleo:ekr-single-inheritence

Conversation

@edreamleo
Copy link
Copy Markdown
Contributor

@edreamleo edreamleo commented Feb 25, 2023

PR for ekr-fork-rope2 #4.

Step 1: Remove all methods from the three Abstract classes, moving:

  • AbstractClass.get_superclasses to pyobjects.PyClass and builtins.BuiltinClass.
  • AbstractFunction.get_param_names and AbstractFunction.get_returned_object to pyobjects.PyFunction`.

Step2: Make PyDefinedObject a subclass of PyObject.

@edreamleo edreamleo marked this pull request as draft February 25, 2023 16:20
@lieryan
Copy link
Copy Markdown
Member

lieryan commented Feb 27, 2023

This change does not look correct to me.

AbstractFunction classes defines the interface for what it means to be a function, it just provides a default implementation so that subclasses don't have to implement anything if it doesn't need to implement something, ditto with the others.

Defining empty interface immediately screams that something is wrong with the new version of Abstract classes.

@edreamleo
Copy link
Copy Markdown
Contributor Author

@lieryan Thanks for your comments! I appreciate your quick reply.

PR #677 supersedes this PR. With your permission I'd like to continue this discussion in PR #677.

@edreamleo edreamleo closed this Feb 27, 2023
@edreamleo edreamleo deleted the ekr-single-inheritence branch February 27, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants