Effective Python: 59 Specific Ways to Write Better Python (Effective Software Development Series)

Author: Brett Slatkin
This Year Stack Overflow 1
This Month Reddit 2


by visene   2019-07-21

Effective python is an awesome book if you already know programming or if you already know python.


by slowpush   2019-07-21

You only need two

Python Tricks


Effective Python



Everyone recommends Fluent Python, but I think it's a little too dense for an intermediate book. You won't appreciate the book until much later.

by onenote   2019-07-21

I'm a big fan of Effective Python for learning idiomatic Python. It has some good sections on concurrency and the limitations of threads in Python. That info on concurrency is before asyncio came out (3.5+), but still pretty helpful.

As far as data driven concerns, I really recommend checking out Designing Data Intensive Applications. Its a language/solution neutral survey of most of the popular solutions and patterns for processing and storing data (relational stores, columnar stores, kafka, all that good stuff). It gives a great overview of the low level details and tradeoffs of each solution.

Python can certainly scale if you're setting up your servers properly, but its main benefit is in being flexible! Good luck!

by tom1018   2019-07-21

Effective Python


by basking2   2019-07-21

I often look for an "Effective Foo" book to learn a language at a deeper level.


They typically prompt me to ask, "why?" I rarely finish them because by about 1/3 of the way in I've accidentally unraveled enough to keep me busy.

I don't claim this will be effective for everyone, but it's a habit that's served me well for a few new languages.

by anonymous   2018-03-19

You can simply convert string to bytes using:


and you can simply convert bytes to string using:


bytes.decode and str.encode have encoding='utf-8' as default value.

The following functions (taken from Effective Python) might be useful to convert str to bytes and bytes to str:

def to_bytes(bytes_or_str):
    if isinstance(bytes_or_str, str):
        value = bytes_or_str.encode() # uses 'utf-8' for encoding
        value = bytes_or_str
    return value # Instance of bytes

def to_str(bytes_or_str):
    if isinstance(bytes_or_str, bytes):
        value = bytes_or_str.decode() # uses 'utf-8' for encoding
        value = bytes_or_str
    return value # Instance of str