Skip to content

Latest commit

 

History

History
86 lines (68 loc) · 1.59 KB

python-built-ins-worth-learning.md

File metadata and controls

86 lines (68 loc) · 1.59 KB

Python Built-ins Worth Learning - My Notes

Notes from reading this article: https://treyhunner.com/2019/05/python-builtins-worth-learning/

Essential / Specialized / Arcane

From these 42+27, choose 30.

Essential: Memorize for fluency

Commonly known

  1. print
  2. len
  3. str
  4. int
  5. float
  6. list
  7. tuple
  8. dict
  9. set
  10. range

Often overlooked by beginners

  1. sum
  2. enumerate
  3. zip
  4. bool
  5. reversed
  6. sorted
  7. min
  8. max
  9. any
  10. all

And to make debugging easier:

  1. breakpoint
  2. dir
  3. vars
  4. type
  5. help

Specialized: Know about to find them effectively later

Learn it later

  1. open
  2. input
  3. repr
  4. super
  5. property
  6. issubclass and isinstance
  7. hasattr, getattr, setattr, and delattr
  8. classmethod and staticmethod
  9. next

Maybe learn it eventually

  1. iter
  2. callable
  3. filter and map
  4. id, locals, and globals
  5. round
  6. divmod
  7. bin, oct, and hex
  8. abs
  9. hash
  10. object

Arcane: Unlikely to need, but know they exist, just in case

"You likely don't need these" (pretty specialized)

  1. ord and chr
  2. exec and eval
  3. compile
  4. slice
  5. bytes, bytearray, and memoryview
  6. ascii
  7. frozenset
  8. import
  9. format
  10. pow
  11. complex