# é¢æ°å®ç¾©ã®éå½¢ãTrueã®expressionãå¾ã§ç½®ãæããã # ããã§ãstringä»£å ¥ãã¦ãããããASTã®ãã¼ããç½®ãæããæ¹ãå®å ¨ãããªæ°ãããã >>> defun=""" def foo(num): return True """ ... ... ... >>> # ASTã«ãã¼ã¹ãã >>> x=ast.parse(defun, mode='single') >>> x <_ast.Interactive object at 0x7f963f9c1950> >>> expression='num==42' # ASTã§Trueã«ããããã¼ããä¸ã®å¼ã«ç½®ãæããã # body,valueã®ã³ã³ããã¼ã·ã§ã³ã¯è©¦è¡é¯èª¤ã§ã¿ã¤ããã # ASTããã³ãããæ©è½ããã£ããç°¡åã«è¦ä»ããã ããã >>> x.body[0].body[0].value=ast.parse(exp
{{#tags}}- {{label}}
{{/tags}}