Useful module to be written by a newbie

Peter Otten __peter__ at
Wed Apr 29 18:27:59 CEST 2015

Cecil Westerhof wrote:

> I have experience with Python, but it has been some time ago. The best
> way to relearn a language (for me) is just make a lot of code with it.
> But it would be nice if it was useful at the same time. I started a
> Python library on GitHub:
> Anyone an idea about functions and classes that would be useful for
> the Python community and could be written by me?

Realistically a Python coder with a little experience will have a glance at 
your code and run away.

But: a family member, or friend, or even you yourself with a small real-
world problem will not care whether your code is idiomatic Python as long as 
it works as advertised. So I'd look that way.

As you idle along you'll quickly get better and may encounter a library 
where you think "That might be a useful extension" or one where you think 
"That's much too complex, I can make it simpler for 80% of the use cases". 

Voilà your contributions to the community.

PS: Regarding your MovingAverage class, have a look at zip(), generators or 
the __iter__() method, and -- most important -- unit tests.

More information about the Python-list mailing list