Use create_simple_object for a lot of use cases
This commit is contained in:
1 parent
2aa2005502
commit
3c78aad8b1
6 files changed
+15
-6
No files matched your search
@@ -174,7 +174,7 @@ def eval_atom(context, atom):
|
||||
|
||||
elif isinstance(atom, tree.Literal):
|
||||
string = parser_utils.safe_literal_eval(atom.value)
|
||||
return ContextSet(compiled.create(context.evaluator, string))
|
||||
return ContextSet(compiled.create_simple_object(context.evaluator, string))
|
||||
else:
|
||||
c = atom.children
|
||||
if c[0].type == 'string':
|
||||
@@ -313,7 +313,7 @@ def eval_factor(context_set, operator):
|
||||
value = context.py__bool__()
|
||||
if value is None: # Uncertainty.
|
||||
return
|
||||
yield compiled.create(context.evaluator, not value)
|
||||
yield compiled.create_simple_object(context.evaluator, not value)
|
||||
else:
|
||||
yield context
|
||||
|
||||
|
||||
Reference in new issue
Block a user