— 5 Comments— 3 Kudos
Philip Trauner
📍 Austria
Last active:
SpaceHey Blog URL:
https://blog.spacehey.com/philip
Philip Trauner's Blog Entries
[Subscribe to this Blog]
— 1 Comment— 2 Kudos
Python Quirks: Implicit Return
Category: Web, HTML, Tech
In Python, functions always have to return something. >>> def foo(): ... pass ... >>> print(foo()) None To ensure that this is the case, instructions that are equivalent to a return None statement are appended to the inner-most code block by the bytecode compiler if no return statement is present. >>> from dis import dis >>> dis(foo) 2 0 LOAD_CONST 0 ( » Continue Reading