Hello All: As an intellectual exercise, I wanted to try my hand at writing some extensions in C.
I was wondering if you all could look over my code and give some feedback. Here is the link for the code: http://pastebin.com/jw3ihfsN I have zero experience coding in C (and not much more coding in Python!). Being a kinetic learner, I thought this would be a good exercise to teach me some of the underpinnings of Python, how it works, why it works the way it does, and as an added bonus, skills to actually write my own extensions if I ever wanted to. I had to learn about pointers to do this, and I'm still not 100% on if I used them correctly herein. I am also very concerned with memory management because I am not sure when I should be calling the memory allocation macros to decref or incref when needed. I would also like to get feedback on how I am constructing C algorithms. As far as the module itself goes, I was able to compile and use it on a windows machine compiling with mingw (I use distutils to do the work, so for me I do "python setup.py build" in my CMD. There are three functions, stats.mean, stats.var, stats.stdev (and they do what you would expect). One thing though, these are the "population" statistics and not "sample" in case you want to test it out. Also, anything else that you think would be worthwile pointing out, tips and tricks, common pitfalls, etc. Thanks in advance for you feedback.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor