Thanks Kent!

-----Original Message-----
From: Kent Johnson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 26, 2005 9:52 AM
To: Gooch, John
Cc: [email protected]
Subject: Re: [Tutor] Are Empty "Placeholder" Functions possible?


Gooch, John wrote:
> Is there a way to create an empty function definition with no lines of 
> code in it? In my coding style I will often do this ( in other 
> languages ) for RAD just to remind myself that I will need to 
> implement the function later.

A block cannot be empty but there is a placeholder statement 'pass' that
does nothing.
> 
> Example: For a file handling class, I may need functions such as 
> copy,delete,move,etc so I want to start off with:
> 
> class FileHandler:
>       def __init__(self):
> 
>       def copy(self):
> 
>       def delete(self):

class FileHandler:
        def __init__(self):
                pass

        def copy(self):
                pass

        def delete(self):
                pass

Kent
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to