Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.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.059 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'dislike': 0.07; 'inserts': 0.07; 'removes': 0.07; 'tia,': 0.09; 'to:name:python- list@python.org': 0.15; 'acceptable.': 0.16; 'better?': 0.16; 'docstring': 0.16; 'examples?': 0.16; 'lowercase': 0.16; 'tipps': 0.16; 'way...': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.22; 'documented': 0.23; 'parameters.': 0.23; 'pep': 0.23; 'subject:please': 0.24; '(like': 0.26; '(in': 0.26; 'module': 0.26; "i'm": 0.26; 'right.': 0.28; 'class': 0.29; 'quite': 0.32; 'does': 0.32; "can't": 0.32; 'object': 0.33; 'to:addr:python- list': 0.34; 'it.': 0.34; 'someone': 0.34; 'too': 0.34; 'copied': 0.34; 'subject:project': 0.34; 'before.': 0.37; 'received:kundenserver.de': 0.37; 'received:moutng.kundenserver.de': 0.37; 'but': 0.37; 'another': 0.37; 'could': 0.37; 'some': 0.38; "i'd": 0.39; 'received:de': 0.39; 'should': 0.39; 'plain': 0.39; 'why': 0.39; 'to:addr:python.org': 0.40; 'might': 0.40; 'more': 0.61; 'type': 0.61; 'types': 0.61; 'your': 0.61; 'here': 0.65; 'received:212.227.17': 0.67; 'header:Reply-To:1': 0.71; 'subject:your': 0.80; 'message-id:invalid': 0.82; '257': 0.84; 'received:172.19.158': 0.84; 'received:172.19.158.52': 0.84; 'received:oxltgw14.schlund.de': 0.84; 'received:schlund.de': 0.84 Date: Tue, 10 Jan 2012 16:46:31 +0100 (CET) From: "patrick@bierans.de" To: "python-list@python.org" In-Reply-To: <4F0C45FA.2060505@sequans.com> References: <2123007772.204183.1326052009748.JavaMail.open-xchange@email.1und1.de <4F0C45FA.2060505@sequans.com> Subject: Re: your feedback to my first project please MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v6.20.0-Rev27 X-Provags-ID: V02:K0:v2LFiHCSbQnW7vcR/QKQyTzpsRsQUBTBl0ONJS5UcdB H9YLhM4NE5eOjYOSD5PHGpFRToyU3/ql6li05pcfKApRyzc0sc us5uY8fX4fUEnFfM7xXG4+lTn33R3vR+p5n3tclUeMXk9PyLdG m94Rl5LvVq0+C5BmzypRCtHwnfy/gbNSLdWywb7xhtjxDqMMag iCBnqKDDI9Yya1L8s9A/ypvgnWWsShhJo6ZWOHjvmEa9RIYW6/ lPlzp9PpV4PdFVItQHBdDxHOLdWr/lkbCir7RdU4+vH7C+5n43 3eeQ9BbhiVTxK9Q+tpRAeZDSp6413Dq5y+iqpbMuZyEL7b3jtl mYTyXoj+2eQVqQzGBwHRvWQUKWgv13sEWj8nfpQ2BHP8WUuDqp nqjizOHKvYIZZNtusULjC4zolAsG+fbdH+1kGjW3v6/yjWwmdT UCRO0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: "patrick@bierans.de" 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326210399 news.xs4all.nl 6950 [2001:888:2000:d::a6]:49951 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18767 > Jean-Michel wrote: Module names should be lowercase You're right. I was too lazy and just copied the class name. I will keep that in mind for the future. ;) > Jean-Michel wrote: I quite dislike your avg method which does more than > averaging, it also inserts a value and removes another modifying the > object in place. It could be very confusing for someone reading your code= . > Fortunately, you have documented it, that makes it acceptable. Why don't > you make avg only averaging. Surely you can use the add method right befo= re. Hm. It is (in most cases) only used in that way... So because I am lazy I thought it might be a good idea. But If I make add() return self I could do chaining, can't I? p.e.: as =3D AverageStack(10) avg =3D as.add(12).avg() Would that be better? > Jean-Michel wrote: A very important information is mising from your > documentation : the type of the parameters. [...] PEP 257 True. I'm still struggling here how to do it. I'd like to write the types into the signature of the method (like in Java) or use some other way like in javadoc. """@param name type description""" Writing it into the docstrin= g as plain text is not very appealing to me. Any concrete tipps or examples? =C2=A0 TIA, Patrick=C2=A0