diff --git a/pymathics/hello/__main__.py b/pymathics/hello/__main__.py index a20ea21..5ca73be 100644 --- a/pymathics/hello/__main__.py +++ b/pymathics/hello/__main__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -from mathics.builtin.base import Builtin, String +from mathics.core.atoms import String +from mathics.core.builtin import Builtin class Hello(Builtin): @@ -8,12 +9,13 @@ class Hello(Builtin):
'Hello'[$person$]
An example function in a Python-importable Mathics module. + >> Hello["World"] = Hello, World! """ # The function below should start with "apply" - def apply_with_name(self, person, evaluation): + def eval_with_name(self, person, evaluation): "%(name)s[person_String]" # %(name)s is just a more flexible way of writing "Hello". # If the class name changes, so will the above pattern. diff --git a/pymathics/hello/version.py b/pymathics/hello/version.py index ccf9b09..b045e29 100644 --- a/pymathics/hello/version.py +++ b/pymathics/hello/version.py @@ -5,4 +5,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="5.0.0dev1" # noqa +__version__="7.0.0dev1" # noqa diff --git a/test/test_hello.py b/test/test_hello.py index 102a9f7..2414449 100644 --- a/test/test_hello.py +++ b/test/test_hello.py @@ -1,6 +1,11 @@ +# -*- coding: utf-8 -*- + +from mathics.core.load_builtin import import_and_load_builtins from mathics.session import MathicsSession -session = MathicsSession(add_builtin=True, catch_interrupt=False) +import_and_load_builtins() + +session = MathicsSession(character_encoding="ASCII") def check_evaluation(str_expr: str, expected: str, message=""):