Deep vs. shallow copy?
rosuav at gmail.com
Fri Mar 14 00:55:44 CET 2014
On Fri, Mar 14, 2014 at 10:41 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Are you trolling again?
> I'm sure that you know quite well that Python doesn't have a procedure
> type. It uses a single keyword, def, for creating both functions and
I'm going to troll for a moment and give you a function that has no
But seriously, this is something that some functions do when they need
to distinguish between returning something and not returning anything.
Look at a dictionary's subscripting (which is effectively a function
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
It can't return None to indicate "there was no such key in the
dictionary", so it raises instead. There's only one way for a Python
function to not have a return value: it has to not return.
More information about the Python-list