Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8dd1ec4

Browse files
committed
simple_eval: handle ast.Constant
This removes a deviation from Python's implementation.
1 parent471fa82 commit8dd1ec4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎bpython/simpleeval.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def simple_eval(node_or_string, namespace=None):
9797
node_or_string=node_or_string.body
9898

9999
def_convert(node):
100+
ifpy3andisinstance(node,ast.Constant):
101+
returnnode.value
100102
ifisinstance(node,_string_type_nodes):
101103
returnnode.s
102104
elifisinstance(node,ast.Num):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp