diff --git a/M2/Macaulay2/d/python.d b/M2/Macaulay2/d/python.d index 18b08f7a7c3..e3e772614dd 100644 --- a/M2/Macaulay2/d/python.d +++ b/M2/Macaulay2/d/python.d @@ -430,8 +430,8 @@ setupfun("pythonWrapM2Function", PyWrapM2Function); -- none -- ---------- -PyNone(e:Expr):Expr := toExpr(Ccode(pythonObjectOrNull, "Py_None")); -setupfun("getPythonNone", PyNone); +setupconst("pythonNone", + Expr(pythonObjectCell(Ccode(pythonObject, "Py_None"), 0xFCA86420))); --------------- -- importing -- diff --git a/M2/Macaulay2/packages/Python.m2 b/M2/Macaulay2/packages/Python.m2 index ede6db2e03d..67bc3976cf5 100644 --- a/M2/Macaulay2/packages/Python.m2 +++ b/M2/Macaulay2/packages/Python.m2 @@ -69,7 +69,6 @@ exportFrom_Core { "objectType"} importFrom_Core { - "getPythonNone", "pythonComplexFromDoubles", "pythonDictNew", "pythonDictSetItem", @@ -81,6 +80,7 @@ importFrom_Core { "pythonLongFromLong", "pythonFloatAsDouble", "pythonFloatFromDouble", + "pythonNone", "pythonObjectGetAttrString", "pythonObjectHasAttrString", "pythonObjectRichCompareBool", @@ -120,8 +120,6 @@ PythonObject#AfterPrint = x -> ( t = replace("<([a-z]+) '(.*)'>"," of \\1 \\2",t); (PythonObject, t)) -pythonNone = getPythonNone() - pythonValue = method(Dispatch => Thing) pythonValue String := s -> ( if debugLevel > 0 then printerr("python command: ", s);