Things learnt about Python
-
How to create a word cloud from text piped via STDIN
on
-
Not to union Python list types
on
-
How to handle convenience imports with Mypy
on
-
How Django’s
override_settings
decorator causes flakey tests
on
-
Mypy skips empty functions
on
-
It’s better to explicitly chain Python exceptions
on
-
About indirect parametrization with Pytest
on
-
That Python’s
datetime
package doesn’t support ordinal suffixes for the day of the month
on
-
How to inspect and clear Python’s
functools.lru_cache
on
-
About Factory Boy’s
SelfAttribute
class
on
-
You can’t use Django’s generic foreign key field with objects stored in a separate database
on
-
About Django’s
setup
method for generic view classes
on
-
How to use
aws-mfa-v2
to avoid entering so many MFA tokens
on
-
About a gotcha with
psycopg2
’s autocommit handling
on
-
Python’s
envparse
library has counter-intuitive boolean casting
on
-
Factory boy can be used to build dicts
on
-
Django settings prefixed with an underscore are private
on
-
Django doesn’t flush caches between tests
on
-
How Django’s management commands need to be type hinted
on
-
File-level flake8 comments ignore all errors
on
-
That Pytest’s “keyword expression” filtering supports Python conditionals
on
-
That FreezeGun doesn’t work with Pytest fixtures (unless you use
pytest-freezegun
)
on
-
About
mypy
’s unreachable code functionality
on
-
About
mypy
’s reveal_type
and reveal_locals
functions
on
-
That
mypy
only type-checks functions that have at least one type annotation
on
-
Python’s
csv.writer
function defaults to Windows line endings
on
-
You can have class-scoped autouse pytest fixtures
on
-
pdbpp
has a useful ‘sticky’ mode
on
-
To prefer
dateutil
over pytz
on
-
Pytest doesn’t play nicely with ipdb
on
-
You can arbitrarily chain Python comparison operations
on
-
You can stack
pytest
’s parametrize
decorators
on
-
You can label parameterized fixtures with pytest
on
-
A better way of configuring
mypy
on
-
datetime.datetime
is a subclass of datetime.date
on
-
About
pip-licenses
on
-
Python 3.7 supports postponed evaluation of annotations
on
-
How to use type annotations with Python’s
csv
module
on
Browse all tags or all posts.