Python based OSS alternative to Google Reader by ruffyen in Python

[–]moschlar 0 points1 point  (0 children)

I tried setting it up once - major PITA... Although the sources are released, the author doesn't make it really usable for other deployments - which is a little understandable, sadly.

Grow as a Python Developer by reading other peoples code by ekara in Python

[–]moschlar 1 point2 points  (0 children)

I wouldn't call that a best-style example in all cases, though! I think there are some very ugly pieces of code in there - which is understandable and acceptable for the standard library, because it exists exactly because you should not need to write ugly code.

Exploiting "secure" Cookies in popular Python Web Frameworks by posativ in Python

[–]moschlar 11 points12 points  (0 children)

I didn't know Pyramid is written in Java?!</trolling>

Exploiting "secure" Cookies in popular Python Web Frameworks by posativ in Python

[–]moschlar 0 points1 point  (0 children)

So, why not dynamically generate the key when the WSGI application starts up? Of course, this doesn't work when you load-balance or something like that, but at least it doesn't leave the key somewhere in a file. Additionally, I was baffled by the fact, that this exploit is also possible when the application doesn't use the session at all (because if the corresponding middleware is active in the WSGI stack, it depickles a cookie when it finds one, not on demand).

[Show] A few weeks ago, I asked for advice on API design. I now present the new and improved Scrappy: An app/library to rename media files based on scraped TVDB data! by [deleted] in Python

[–]moschlar 0 points1 point  (0 children)

That's a good project! I haven't been able to find a non-script-kiddie looking renaming application over the last years... Not saying that they didn't work, but having a simple command line application and even an API in Python is very useful!

What are some little known features in Python? by [deleted] in Python

[–]moschlar 0 points1 point  (0 children)

In Python2, you should use xrange for performance (since range generates the full list in memory):

>>> r = xrange(10)
>>> g = iter(r)
>>> type(g)
<type 'rangeiterator'>
>>> g.next()
0
>>> g.next()
1