Working on a Python tech-lab. It's going to talk about the Python ecosystem, Openstack, and how to make the most of it. Licensed under CC-BY-SA 4.0 when it's done! ![](http://i.imgur.com/n4m5vsL.jpg) ---- `asyncio` is nice, but at don't see it working outside of a niche. The problem is that a library is either written for asynchronicity or not, and if it's not, it can't be converted, and it can be used in an asynchronous framework (I believe monkeypatching is not a real solution, since it just make some synchronous code asynchronous, sweeping all synchronization problems under the rug). That means that we have to ecosystems: you can't use requests with `asyncio`. The only solution would be to implement all IO libs in an asynchronous way and to provide blocking wrappers for synchronous usage (like what `crochet` does), but that's not going to happen. `asyncio` is not the messiah everybody seems to think it is, and will soon be forgotten outside of circles where people need concurrency. ---- The `copy` module provides methods for both shallow and deep copy which allow you to copy mutable structures like dictionaries if you want to avoid mutating dictionaries that are passed to your code. ---- Discovered the [array module](https://docs.python.org/2/library/array.html) for representing homogeneous data. Also this [very neat tip](http://stackoverflow.com/questions/3470398/list-of-integers-into-string-byte-array-python) for creating a byte string from an array of integers. ---- More binary/string/decimal operations: ``` "{0:032b}".format(my_int) ``` Converts an int into a string of zeroes and ones (32 for 32-bit number). ``` int(my_string, 2) ``` Converts a string of zeros and ones into an integer ---- Convert a tuple to a named tuple with the star modifier ` my_named_tuple = MyNamedTuple(*a_tuple) ` From [Stack Overflow](http://stackoverflow.com/questions/25000159/how-to-cast-tuple-into-namedtuple)