Doug Hellmann writes Python Module of the Week, a series of tutorials with examples for modules in the Python standard library.
HN commenters strongly recommend PyMOTW as a concise introduction and a go-to resource for learning the Python standard library.
Money down 3 months later:
1) the gateway or more likely something behind it starts crashing for memory errors when someone is serializing some stupidly large array into it
2) using ordered vs non-ordered keys on input changes the behavior and fixes it
3) enabling this checkbox to prevent it fixes the issue and guards against it happening again
4) everyone has forgotten about this web weenies inquiry into the issue
5) due to #4, it takes like 3 weeks of system crashes and hairy debugging to find the cause
6) this guy is long gone, having ridden off into the sunset of smugness
Also:
1) fixing the serialization-dependent memory allocation 4 layers deep on the back-end to allow things to operate safely without this checkbox requires a complex change to several other components and associated system-wide validation testing which would take: drumroll "9 people 6 months to complete"
2) What is the point of this javadoc reference and how exactly does it relate to the issue at hand? Here's a random code doc reference too!: https://pymotw.com/3/collections/ordereddict.html and here also a discussion about impacts: https://mail.python.org/pipermail/python-dev/2016-September/thread.html#146327
When I recently used python, after a long absence, I was pleased to discover named tuples: https://pymotw.com/2/collections/namedtuple.html
They basically give you the light syntax you were looking for.
Related, I was also very pleased to discover mypy for static type checking. I am convinced that it sped up development of my project by an order of magnitude or so. Especially since I was using the also new async/await syntax (something I was also very pleased to discover for my particular project, and it had nothing to do with the web). The use of async/await leads to quite elaborate types, with easily made mistakes that are very painful if only caught at runtime, instead of trivially at compile time.
Together, named tuples and static type checking brought in some much missed aspects of C into python.
If you work with other languages in addition to Python, it's easy to fall back into old habits. You should internalize the content from these two excellent presentations:
Raymond Hettinger's "Transforming Code into Beautiful, Idiomatic Python":
http://pyvideo.org/video/1780/transforming-code-into-beautiful-idiomatic-pytho
(pyvideo.org has a lot of other great talks and presentations.)
Ned Batchelder's "Loop Like A Native":
http://nedbatchelder.com/text/iter.html
Python Module of the Week is also an excellent resource:
http://pymotw.com/2/
Maybe this? http://pymotw.com/2/profile/
From here: https://hn.algolia.com/?q=python+profile#!/story/forever/0/python%20profile
I use pinboard to bookmark anything that I think has the slightest chance that I'll want to see it again. Most of the time I never look at a bookmark again, because you usually don't know what you'll need in the future. But I've found enough things like what you're looking for (but not this time obviously) that the practice has become worthwhile.
https://pinboard.in/
I dont have access to python 3.5 but i tried above code with some modifications and it worked!
1. `while True` has no break condition and that intentional but `mt.join()` basically waits till all threads are completed? are you looking thread that keeps on running? i suggest look at daemon thread? if yes, check this https://pymotw.com/2/threading/#daemon-vs-non-daemon-threads
2. `return` & `yield from None` are not required! I had commented those lines, also 'from' is a reserved keyword
Python3 has pretty good built in modules for asyncio, multiprocessing, and multithreading. Maybe port to py3 and utilize these features as an intermediate step while you are working on the jump to Go. I like to take a function for a single work unit "do a single thing" and then call it from a function utilizing asyncio and multithreading, this link shows a great examples.
https://pymotw.com/3/asyncio/executors.html