Encapsulation, inheritance and polymorphism

Andrew Berg bahamutzero8825 at gmail.com
Tue Jul 17 13:37:07 CEST 2012

On 7/17/2012 6:01 AM, Lipska the Kat wrote:
> Anyway, I'm looking at Python as a rapid prototyping language.
> I have an idea and just want to get it down in basic outline code as 
> quickly as possible before it departs my aging brain... I'm not used to 
> using variables without declaring their type ... (well I used to do 
> Visual Basic many years ago) It just seems so weird, and what's this 
> obsession with 'correct' indentation of code ???
"Pythonic" is (or at least should be) a word you encounter frequently in
discussions of Python code. Learn what is considered Pythonic and then
write Python code that way if you want to work with the language rather
than fight it. Duck-typing is very Pythonic and so is readable code. As
Dave mentioned, indentation is part of the syntax - blocks must be
indented with either tabs or spaces (choose one - if you mix them
ambiguously, an IndentationError will be raised). Try "from __future__
import braces" and "import this" for some insight. ;)

The official tutorial gives a great overview of the language and has
links to reference material that goes into greater detail:
http://docs.python.org/tutorial/ (Python 2.7)
http://docs.python.org/py3k/tutorial/ (Python 3.2)

On a side note, I would highly recommend learning Python 3 (3.2 is the
latest stable version) unless you have an explicit need for Python 2
(some major 3rd-party libraries have not been ported yet). Python 2
won't get any new features; it will simply get bug fixes until its EOL
in 2014 (15?).
CPython 3.3.0b1 | Windows NT 6.1.7601.17803

More information about the Python-list mailing list