Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Correct type for a simple "bag of attributes" namespace object Date: Sun, 03 Aug 2014 17:51:10 +0300 Organization: A noiseless patient Spider Lines: 18 Message-ID: <87wqaplj8h.fsf@elektro.pacujo.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="29547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+F7m43Mgn/GqjExCPsHkrf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:UG1YL7sk20LQBzVjkIwYFpy2juc= sha1:0bvxydnqkxOg92nIZCrT8W3wJnA= Xref: csiph.com comp.lang.python:75603 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. Classes may or may not save RAM, but that is rather a low-brow point of view toward OO. Marko