Skip to content
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

Split the merging definitions code from Definitions.get_definition #1280

Merged
merged 9 commits into from
Jan 10, 2025

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Jan 10, 2025

This PR continues the simplification of the code in the mathics.code.definitions module.

@rocky
Copy link
Member

rocky commented Jan 10, 2025

LGTM

@@ -1150,3 +880,281 @@ def get_history_length(self) -> int:
if history_length is None or history_length > 100:
history_length = 100
return history_length


def autoload_files(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved to the end?

Also, autoloading files feels more like a session kind of thing than a "core" function. And finally the mathics.core.definitions module is pretty large so moving this somewhere else would balance things in terms of size too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because merge_definitions requires the class Definition to be defined, and seems reasonable to out all the functions together.

And yes, some of these functions should be moved to other places.

@mmatera mmatera merged commit 1073444 into master Jan 10, 2025
14 checks passed
@mmatera mmatera deleted the even_more_on_definitions branch January 10, 2025 09:00
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