Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.049 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'python': 0.09; 'received :mail-qc0-f174.google.com': 0.09; 'language': 0.14; 'cares': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'heap': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'integer': 0.17; 'thu,': 0.17; 'module': 0.19; 'code.': 0.20; 'java': 0.21; 'object.': 0.22; 'oriented': 0.22; "python's": 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'looks': 0.26; 'am,': 0.27; 'plain': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'function': 0.30; 'getting': 0.33; 'says': 0.33; 'to:addr :python-list': 0.33; 'that,': 0.34; 'version': 0.34; 'received:google.com': 0.34; 'too.': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'moment': 0.37; 'passed': 0.37; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'performance': 0.39; 'to:addr:python.org': 0.39; 'takes': 0.39; 'little': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'subject:, ': 0.61; 'different': 0.63; 'costs': 0.64; 'making': 0.64; 'jul': 0.65; 'distinguish': 0.84; 'hit.': 0.84; 'kat': 0.91; 'subject:skip:E 10': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RwQkOVe+CpIrV7JXokUhI1GGWPy9cd/0T77//ZfaJMo=; b=qflzRHqjXpAxFD77qPA8jpiQtuLCuUr3WCgn2NzbW+AsG6WfFW7huCjEy9u/gc3bqR /CWOrZZKESGUyiDaokx/Vu4jEQTKBvzoX+nmV3u7XXlgkSXvgztH2sOvh+4HfpMvpwuV EJ3deHwCuGTRpJfCqmPe+7H1cX8wzEWQtekPYHGeWJctPapYLbEyokAVMvgyODuTcynR UOLxg52bpQBcIBQ8wQTQmLPRDVpWJocC8zCdWDglnCwzUpbhmsyl+daixqsol2ilKhWj i9JHYOprWyQsz9k5K6fN/z9lKYK6XqQCeUan55Gvl2glTXjck129cynqhgycA1dxq85T /Ing== MIME-Version: 1.0 In-Reply-To: References: <3vnfd9-343.ln1@satorlaser.homedns.org> <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> <5005A103.9050802@stoneleaf.us> <5006b48a$0$29978$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 19 Jul 2012 01:04:50 +1000 Subject: Re: Encapsulation, inheritance and polymorphism From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342623893 news.xs4all.nl 6987 [2001:888:2000:d::a6]:52630 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25575 On Thu, Jul 19, 2012 at 12:40 AM, Lipska the Kat wrote: > Python looks like an interesting language and I will certainly spend time > getting to know it but at the moment it seems to me that calling it an > Object Oriented language is just plain misleading. Python isn't object oriented in the way Java is ("EVERYTHING has to be in a class! Look, it's all OO now!"). It simply says that, well, what's the difference? That integer you're holding. That's an object. Your function is an object. The module you're in, your "global scope", is an object too, and can be passed around. Python doesn't care about buzzwords, it cares about making code. Of course, the simplicity of Python's object model has its costs too. Every little integer has to be memory-managed and garbage-collected (eg in CPython, they're all refcounted). That has a performance hit. But not all that big a hit, and it is so handy when you want your function to be able to accept, and distinguish between, different types of object - you don't have to write one version that takes an integer and a different one that takes a heap object. ChrisA