Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18767 > unrolled thread

Re: your feedback to my first project please

Started by"patrick@bierans.de" <patrick@bierans.de>
First post2012-01-10 16:46 +0100
Last post2012-01-10 16:46 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: your feedback to my first project please "patrick@bierans.de" <patrick@bierans.de> - 2012-01-10 16:46 +0100

#18767 — Re: your feedback to my first project please

From"patrick@bierans.de" <patrick@bierans.de>
Date2012-01-10 16:46 +0100
SubjectRe: your feedback to my first project please
Message-ID<mailman.4602.1326210399.27778.python-list@python.org>
> 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 before.

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 = AverageStack(10)
avg = 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 docstring
as plain text is not very appealing to me. Any concrete tipps or examples?
 
TIA,
Patrick 

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web