Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; '(python': 0.05; 'cpython': 0.05; 'fixes': 0.05; 'mentioned,': 0.07; 'prototyping': 0.07; 'python': 0.09; '__future__': 0.09; 'bug': 0.10; 'language': 0.14; 'discussions': 0.15; '"from': 0.16; '"import': 0.16; '3.2)': 0.16; 'blocks': 0.16; 'ported': 0.16; 'pythonic': 0.16; 'readable': 0.16; 'received:209.85.161.174': 0.16; 'tabs': 0.16; 'url:py3k': 0.16; 'wrote:': 0.17; 'variables': 0.17; '(or': 0.18; 'windows': 0.19; 'code.': 0.20; 'import': 0.21; 'explicit': 0.22; 'libraries': 0.22; 'seems': 0.23; 'idea': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'language.': 0.27; '???': 0.27; 'mix': 0.27; 'indentation': 0.29; 'spaces': 0.29; "i'm": 0.29; 'basic': 0.30; 'code': 0.31; 'url:python': 0.32; 'quickly': 0.32; 'goes': 0.33; 'material': 0.33; 'to:addr:python-list': 0.33; 'tutorial': 0.33; 'received:google.com': 0.34; 'stable': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'message-id:@gmail.com': 0.36; 'url:org': 0.36; 'visual': 0.36; 'should': 0.36; 'possible': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:docs': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'subject:, ': 0.61; 'side': 0.61; 'latest': 0.61; 'skip:6 10': 0.63; 'great': 0.64; 'frequently': 0.65; 'aging': 0.84; 'kat': 0.91; 'url:tutorial': 0.93; 'subject:skip:E 10': 0.95; 'fight': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=wd/HqIxHmtPihmuxubRSHVBYZ1W/1T4Ca4QwyFMa60g=; b=GzzlzqvcmAYGCEP99xbqpk1mdzdbxsFBzMzAErD9R+6A14YLCZg/sBiJk/wh4w8ijR YNXU048E/3BBYcg5P/OatIj69N7oGWuP8lDGv2jgtP5APXoz8WciYc9pr2IYSkpkmCMo C+/YGjCtove74u/Yip0n3ugBnW278YBjwWAeQhos8ORwKFuN7ZB5WBJPFO7y1NXsmVpo oeq/ODfCUCm3kDrGnG9Bp9Db5O6fT0rULnmjDhqfQ5jwY3pZl9XZYgeOZw1+kdGUpqWe bNnS5kU2Wua3T+Y/6UVyO8q2vLa1qZqP2g37JX8Rkd+FSTOY+kQH8rSSJaxK1goFflb0 2Riw== Date: Tue, 17 Jul 2012 06:37:07 -0500 From: Andrew Berg User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: "comp.lang.python" Subject: Re: Encapsulation, inheritance and polymorphism References: <3vnfd9-343.ln1@satorlaser.homedns.org> <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> In-Reply-To: <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342525038 news.xs4all.nl 6873 [2001:888:2000:d::a6]:39813 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25488 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