-
-
Notifications
You must be signed in to change notification settings - Fork 65
Move import forms *before* use of PrintForms #587
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,17 +112,23 @@ def __init__( | |
| "System`", | ||
| "Global`", | ||
| ) | ||
|
|
||
| # Importing "mathics.format" populates the Symbol of the | ||
| # PrintForms and OutputForms sets. | ||
| # | ||
| # If "importlib" is used instead of "import", then we get: | ||
| # TypeError: boxes_to_text() takes 1 positional argument but | ||
| # 2 were given | ||
| # Rocky: this smells of something not quite right in terms of | ||
| # modularity. | ||
|
|
||
| import mathics.format # noqa | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not directly related to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I was talking about that variable, sorry.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| self.printforms = list(PrintForms) | ||
| self.outputforms = list(OutputForms) | ||
| self.trace_evaluation = False | ||
| self.timing_trace_evaluation = False | ||
|
|
||
| # This loads all the formatting functions. | ||
| # It needs to be early because it can be used in | ||
| # messages during the builtins loading. | ||
| # Rocky: this smells of something not quite right in terms of modularity. | ||
| import mathics.format | ||
|
|
||
| if add_builtin: | ||
| from mathics.builtin import modules, contribute | ||
| from mathics.settings import ROOT_DIR | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it is a side effect of lack of modularity. The problem is that
mathics.formatrequiresmathics.builtin.box, and it depends onmathics.builtin.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. In which line this happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not an error, it is just that the output won't get tagged (which is the point of the change) since
result.formwill beNonebecause nothing inoutput_forms: