Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!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; 'ignored': 0.07; '"class"': 0.09; 'latter': 0.09; 'objects,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'creates': 0.14; 'employee.': 0.16; 'extensible': 0.16; "objects'": 0.16; 'objects.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:object': 0.16; 'subject:simple': 0.16; 'subject:type': 0.16; 'superfluous': 0.16; 'wrote:': 0.18; 'typing': 0.19; 'memory': 0.22; 'header :User-Agent:1': 0.23; "i've": 0.25; 'equivalent': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'am,': 0.29; 'membership': 0.31; 'consumption': 0.31; 'class': 0.32; 'classes': 0.35; 'possible.': 0.35; 'operations': 0.35; 'there': 0.35; 'really': 0.36; 'keyword': 0.36; 'implement': 0.38; 'to:addr:python-list': 0.38; 'received:71': 0.39; 'subject:" ': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'reached': 0.63; 'more': 0.64; 'pays': 0.65; 'close': 0.67; 'concept.': 0.84; 'delegation': 0.84; 'otten': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Correct type for a simple "bag of attributes" namespace object Date: Sun, 03 Aug 2014 18:55:13 -0400 References: <7ef67ccc-3fc3-47dd-b858-09ef3b57a497@googlegroups.com> <87r40zmkhr.fsf@elektro.pacujo.net> <53dd0717$0$29973$c3e8da3$5496439d@news.astraweb.com> <70e5f2f1-661f-40f2-bb7a-76e569c4d092@googlegroups.com> <1407057464.64980.YahooMailNeo@web163806.mail.gq1.yahoo.com> <1407063072.46317.YahooMailNeo@web163803.mail.gq1.yahoo.com> <87wqaplj8h.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-71-175-90-87.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <87wqaplj8h.fsf@elektro.pacujo.net> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407106537 news.xs4all.nl 2858 [2001:888:2000:d::a6]:38026 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75626 On 8/3/2014 10:51 AM, Marko Rauhamaa wrote: > Peter Otten <__peter__@web.de>: > >> i. e. you have a per-class and per-instance memory consumption. The >> latter is smaller, so with regards to memory consumption instantiating >> only pays off when there is more than one employee. > > I've reached a point where I think classes are a superfluous OO concept. > You only need objects. > > Python is close to that reality. The "class" keyword really creates a > function that creates objects, and the objects' class membership is > ignored in ducktyping. The object class is used to implement duck typing. It is the delegation of operations to class instance methods that makes extensible duck typing possible. 'a + b' is equivalent to type(a).__add__(a, b) -- Terry Jan Reedy