Live data from Hacker News

Ask HN: Good Python codebases to read?

news.ycombinator.com

41–50 of 153 posts

Re: Ask HN: Good Python codebases to read?

#41

Jumping on the Kenneth Reitz train, you might check out The Hitchhiker's Guide to Python: http://docs.python-guide.org/en/latest/ He recommends the following Python projects for reading: * Howdoi ( https://github.com/gleitz/howdoi ) * Flask ( https://github.com/mitsuhiko/flask ) * Werkzeug ( https://github.com/mitsuhiko/werkzeug ) * Requests ( https://github.com/kennethreitz/requests ) * Tablib ( https://github.com/k…

Holy crap! I don't know if this helps or hinders! ;)

Thank you for this resource, much appreciated!

Re: Ask HN: Good Python codebases to read?

#42
post #25
post #18

Earlier quoted context omitted.

PEP-257 is where you can find documentation on them. https://www.python.org/dev/peps/pep-0257/

Thanks for that, and thank you for getting me into the whole PEP. Previously I had only heard about PEP 8, and I thought that was just it , an opinionated piece about how to write Python. Now I have a whole other source of information to look at. And for people who will no doubt call me out on this, I have been working on Zed's LPtHW for about a month. I have done numerous searches regarding Python problems, and this…

The features added in PEPs should be incorporated into the documentation -- if they're not, please file a bug -- so people mostly don't refer to PEPs except for historical purposes.

It's not code, but also see Raymond Hettinger's talk "Beyond PEP 8" on YouTube. Actually, pretty much any talk by Hettinger is worth watching:

http://pyvideo.org/speaker/138/raymond-hettinger

Re: Ask HN: Good Python codebases to read?

#44

Openstack does a large amount of testing for their code[1] but they is a huge amount of it. Barbican[2] is one of the newer less crufty components. [1]: https://github.com/openstack/openstack [2]: https://github.com/openstack/barbican

Openstack is so large it also has a plethora of examples of bad code. Especially in vendor-contributed drivers and such. I wouldn't pay attention to the code so much as the incredible infrastructure and process that manages it and improves it over time. Seriously, I've seen "sychronization threads" that use no synchronization primitives that have a single bare exception handler trap the critical section. The handler…

I happen to agree, Ive been working on it for the past year and its sort of killed my drive to work with something 'big' again.

That being said Barbican is quite good, which I think is due to its proof of concept being written in Go[1] before being ported.

If you want to learn decent testing Openstack is a good example, the code as a whole not so much. This also only applies if you want to use unittest or their custom test module, testtools. py.test is a much nicer way to do testing IMO

[1]: https://www.youtube.com/watch?v=245rSZBdm9s

Re: Ask HN: Good Python codebases to read?

#45

Openstack does a large amount of testing for their code[1] but they is a huge amount of it. Barbican[2] is one of the newer less crufty components. [1]: https://github.com/openstack/openstack [2]: https://github.com/openstack/barbican

Openstack is so large it also has a plethora of examples of bad code. Especially in vendor-contributed drivers and such. I wouldn't pay attention to the code so much as the incredible infrastructure and process that manages it and improves it over time. Seriously, I've seen "sychronization threads" that use no synchronization primitives that have a single bare exception handler trap the critical section. The handler…

Hey, thanks for that type of input. This is exactly why I posed the question on HN. I really have no idea on how to judge Python code, so that's why I put the question to the community. I am looking for good code, but I don't (can't) know it when I see it, so I trust you guys to lead me to it.

Thank you for all the good replies peeps!

Re: Ask HN: Good Python codebases to read?

#48
post #34
post #25

Earlier quoted context omitted.

Thanks for that, and thank you for getting me into the whole PEP. Previously I had only heard about PEP 8, and I thought that was just it , an opinionated piece about how to write Python. Now I have a whole other source of information to look at. And for people who will no doubt call me out on this, I have been working on Zed's LPtHW for about a month. I have done numerous searches regarding Python problems, and this…

PEPs are basically the Python community's RFCs (if you're familiar with those). BTW, what you call "an opinionated piece on how to write Python" was originally written by Guido van Rossum, the guy who invented Python in the first place. I think that gives him the right to say something on the topic... (You ought to know that Python has a large following with a strong community feeling. Making negative remarks about t…

I do know the idea behind RFCs.

And I hope that other people don't think I used the wording 'opinionated' in a negative way. I do know about the concept of a BDFL, and I do know that Guido was behind those comments.

But I still stand behind my assessment that the PEP 8 comments are opinionated. And maybe rightly so. ;)

Re: Ask HN: Good Python codebases to read?

#49
post #48
post #34

Earlier quoted context omitted.

PEPs are basically the Python community's RFCs (if you're familiar with those). BTW, what you call "an opinionated piece on how to write Python" was originally written by Guido van Rossum, the guy who invented Python in the first place. I think that gives him the right to say something on the topic... (You ought to know that Python has a large following with a strong community feeling. Making negative remarks about t…

I do know the idea behind RFCs. And I hope that other people don't think I used the wording 'opinionated' in a negative way. I do know about the concept of a BDFL, and I do know that Guido was behind those comments. But I still stand behind my assessment that the PEP 8 comments are opinionated. And maybe rightly so. ;)

Doesn't Guido himself preface some of the things in PEP8 as being his pet peeves?
Post reply on HN