A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/088150.html below:

Idiom gone, or did it really ever exist? () is ()

Idiom gone, or did it really ever exist? () is ()Remco Gerlich scarblac at pino.selwerd.nl
Wed Apr 18 20:23:02 EDT 2001
D-Man <dsh8290 at rit.edu> wrote in comp.lang.python:
> On Wed, Apr 18, 2001 at 03:26:12AM -0400, Mike C. Fletcher wrote:
> | You want this kind of construct when creating "generic services" that can
> | process any object type (including None), so need to be able to determine
> | whether the object passed is, in fact, the value None, or merely the absence
> | of a value.
> 
> Umm, I might be missing something but I think the following does that
> :
> 
> 
> def my_func( an_arg ) :
>     do_something( an_arg )
> 
> 
> If it is called with the absence of a value, an error will be raised
> by the interpreter, otherwise it is passed an object (possibly None).

His function should also work when no argument was given. Except it should
do something special then.

-- 
Remco Gerlich

More information about the Python-list 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