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/2006-June/065844.html below:

Allow Empty Subscript List Without Parentheses

[Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses [Python-Dev] Pre-PEP: Allow Empty Subscript List Without ParenthesesBJörn Lindqvist bjourne at gmail.com
Sun Jun 11 03:04:38 CEST 2006
> > And from a syntax perspective, it's a bad idea.  x[] is much
> > more often a typo than an intentional attempt to index a
> > zero-dimensional array.
>
> but how often is it a typo?
>
> for example, judging from c.l.python traffic, forgetting to add a return
> statement is a quite common, but I haven't seen anyone arguing that we
> deprecate the implied "return None" behaviour.

Sounds like a terrific idea. The implicit None behaviour has hit me
many times and:

something = somefunc()

is almost always an error if somefunc() doesn't have an explicit
return statement. I don't know how difficult it is to get rid of the
implicit "return None" or even if it is doable, but if it is, it
should, IMHO, be done.

-- 
mvh Björn
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