A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-January/147193.html below:

[Python-Dev] FunctionDef.returns - explicit 'None' return type hint

[Python-Dev] FunctionDef.returns - explicit 'None' return type hint [Python-Dev] FunctionDef.returns - explicit 'None' return type hintValentin Iovene valentin at too.gy
Thu Jan 19 16:34:35 EST 2017
> >>> t = compile('def f(): pass', '', 'exec', ast.PyCF_ONLY_AST)
> >>> print(t.body[0].returns)
> None
> >>> t = compile('def f() -> None: pass', '', 'exec', ast.PyCF_ONLY_AST)
> >>> print(t.body[0].returns)
> <_ast.NameConstant object at 0x10a900f28>
> >>>  print(t.body[0].returns.value)
> None

My bad, thank you my King. ;)

-- 
Valentin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4