Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search
 

Here's an interesting little language tidbit:

All "methods" of a class are functions. By definition, functions return a value, and procedures do not. In Python, there is no such thing as a procedure. A Python function implicitly returns None, if no other return statement is defined in the function.

IIRC, the word "method" came into use in OOP as a catch-all for OO languages that had both functions and procedures -- Java being a prime example. Since Python only has functions, it might be useful to mention this fact. It may or may not be useful to use the word "function" consistently rather than the word "method", because of this difference. On the other hand, this is an admittedly minor quibble, and perhaps does not belong in a book on patterns. A book on Python, though, should definitely mention this difference.

f  e  x



Add your comment below. Use an empty line between each paragraph. Paragraphs will be automatically formatted, and single carriage returns will be respected. Use <code> to begin a code block, and </code> to end a code block. Your email address will not be visible to spam harvesters or used in any way except to contact you with further questions.

Your Email Address:

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.