Python 101: Equality vs Identity

People who are new to the Python programming language can get a bit confused about the difference between “==” (equality) and Python’s keyword “is” (identity). I have even seen experienced programmers who will find the difference subtle enough that they will introduce logic errors in their code do to a misunderstanding between the two. In […]

Python 101: Equality vs Identity Read More »

Python’s New secrets Module

Python 3.6 added a new module called secrets that is designed “to provide an obvious way to reliably generate cryptographically strong pseudo-random values suitable for managing secrets, such as account authentication, tokens, and similar”. Python’s random module was never designed for cryptographic use but for modeling and simulation. Of course, you could always use the

Python’s New secrets Module Read More »

What’s New in Python: Asynchronous Comprehensions / Generators

Python 3.6 added the ability to create Asynchronous Comprehensions and Asynchronous Generators. You can read about asynchronous comprehension in PEP 530 while the asynchronous generators are described in PEP 525. The documentation states that you can now create asynchronous list, set and dict comprehensions and generator expressions. Their example looks like this: result = [i

What’s New in Python: Asynchronous Comprehensions / Generators Read More »