Lessons about Python (page 22)
The links, tools and tips our engineers and designers share with each other, one “today I learned” at a time.
- lessons shared
- 353
- people sharing
- 27
- database started in
- 2016








- Link offlineLink offline
Tech Insights· pybee.org
A Javascript implementation of the Python virtual machine:
Shared by
The original link on pybee.org is no longer available.
Look for it on the Wayback Machine- JavaScript
- Python

blog.gahooa.com
In Python, you can force your function arguments to be supplied with only with keywords:
Maybe I should have known this about Python by now, but… Little did I know (was wishing for it today), but there IS a way to specify that arguments MUST be keyword only. In this case, everyth…
Flávio Juvenal

Tech Insights· blog.gahooa.com
In Python, you can force your function arguments to be supplied with only with keywords:
From blog.gahooa.com
Maybe I should have known this about Python by now, but… Little did I know (was wishing for it today), but there IS a way to specify that arguments MUST be keyword only. In this case, everyth…
Shared by
Read on blog.gahooa.com- Python
Today I learned
Before using
itertools.groupby(data, keyfunc)remember to sort thedatawith the same keyfunc.Victor Carriço
Tech Insights
Before using
itertools.groupby(data, keyfunc)remember to sort thedatawith the same keyfunc.Shared by
- Itertools
- Python
Tech Insights
For tests use
assertCountEqual, using two sequences it tests if the first contains the same elements as second, regardless of their order.Shared by
- Python
- Test
- Link offline
pybit.es · offline
this article explains how to write a decorator that accepts and optional argument
Filipe Ximenes
Link offlineTech Insights· pybit.es
this article explains how to write a decorator that accepts and optional argument
Shared by
The original link on pybit.es is no longer available.
Look for it on the Wayback Machine- Decorators
- Python

dbader.org
Don't know how to use decorators? Here is a quick guide:
Understanding decorators is a milestone for any serious Python programmer. Here’s your step-by-step guide to how decorators can help you become a more efficient and productive Python developer.
Rebeca Sarai

Tech Insights· dbader.org
Don't know how to use decorators? Here is a quick guide:
From dbader.org
Understanding decorators is a milestone for any serious Python programmer. Here’s your step-by-step guide to how decorators can help you become a more efficient and productive Python developer.
Shared by
Read on dbader.org- Python
Tech Insights
Need to use
toxwhile usingpyenv? Don't forget to use the packagestox-pyenvforpyenvsupport andpyenv-implicitto make it find the correct python executable.Shared by
- Pyenv
- Python
- Test
- Tox
Tech Insights
To use querystring in urls when using
responselibrary for tests, remember to setmatch_querystring=Truein youraddmethodShared by
- Python
- Test

docs.djangoproject.com
To add a “human touch” to data use: #module-django.contrib.humanize
Rebeca Sarai

Tech Insights· docs.djangoproject.com
To add a “human touch” to data use: #module-django.contrib.humanize
Shared by
Read on docs.djangoproject.com- Python


Tech Insights· docs.python.org
If you are testing sending emails in your project and are using mock, use
call_args_listmethod to see a list of all the calls made to the mock object in sequence: #unittest.mock.Mock.call_args_listShared by
Read on docs.python.org- Python
- Test

gist.github.com
pyenvfor multiple Python installations on OS X.$ brew update $ brew install pyenv $ pyenv install 3.5.0 $ pyenv install 3.4.3 $ pyenv install 3.3.6 $ pyenv install 3.2.6 $ pyenv install 2.7.10 $ pyenv install 2.6.9 $ pyenv versions * system (set by /Users/bouke/.pyenv/version) 2.6.9 2.7.10 3.2.6 3.3.6 3.4.3 3.5.0 Then, when you need a certain version: pyenv local 3.5.0 This will create a file .python-version, so pyenv will remember the Python version for this directory.
Felipe Farias

Tech Insights· gist.github.com
pyenvfor multiple Python installations on OS X.$ brew update $ brew install pyenv $ pyenv install 3.5.0 $ pyenv install 3.4.3 $ pyenv install 3.3.6 $ pyenv install 3.2.6 $ pyenv install 2.7.10 $ pyenv install 2.6.9 $ pyenv versions * system (set by /Users/bouke/.pyenv/version) 2.6.9 2.7.10 3.2.6 3.3.6 3.4.3 3.5.0Then, when you need a certain version:
pyenv local 3.5.0This will create a file
.python-version, so pyenv will remember the Python version for this directory.Shared by
Read on gist.github.com- Env
- Osx
- Python

github.com
Whenever you need to search deep into dictionaries, a good tool for that is
A python library for accessing and searching dictionaries via /slashed/paths ala xpath. - dpath-maintainers/dpath-python
Carlos Coelho

Tech Insights· github.com
Whenever you need to search deep into dictionaries, a good tool for that is
From github.com
A python library for accessing and searching dictionaries via /slashed/paths ala xpath. - dpath-maintainers/dpath-python
Shared by
Read on github.com- Dict
- Python
Today I learned
Use
pip list --not-requiredto see your main packages without dependencies.Anderson Resende
Tech Insights
Use
pip list --not-requiredto see your main packages without dependencies.Shared by
- Pip
- Python

github.com
Pretty and useful exceptions in Python, automatically:
Pretty and useful exceptions in Python, automatically. - Qix-/better-exceptions
Flávio Juvenal

Tech Insights· github.com
Pretty and useful exceptions in Python, automatically:
From github.com
Pretty and useful exceptions in Python, automatically. - Qix-/better-exceptions
Shared by
Read on github.com- Python

github.com
Safely create links from user inputted text with Bleach library:
Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes - mozilla/bleach
Flávio Juvenal

Tech Insights· github.com
Safely create links from user inputted text with Bleach library:
From github.com
Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes - mozilla/bleach
Shared by
Read on github.com- Python
Book a call
Found it useful?
Let’s put it to work.
Tell us about your product and the problem in front of you. We’ll bring what we’ve learned on real projects.
Tell us about your product, and we’ll bring what we’ve learned.
Still prefer the good old email? Contact us



