1. b.93z.org
  2. Notes

Abbreviations in Python code

When you need to code fast, efforts to type “transaction” look somewhat funny. Why don’t just use abbreviations that will save you from a lot of typing? However, they need to be consistent, so some system of abbreviations is necessary. Such system may look like this:

kw
kwargs
inst
instance
txn
transaction
ctx
context
pth (sometimes is useful)
path
cls
class
fmt
format
mw
middleware
th
thread
dfd
deferred
cb
callback
tmpl
template
fn
filename
dir
directory
ext
extension
app
application
pr
processor (thing that is called middleware in Django)
fs
formset
cmd
command

For futher reading: PEP 8, Sergey Schetinin’s style guide and Pocoo’s one.

© 2008–2017 93z.org