Skip to content

Notes of Python Tricks: A Buffet of Awesome Python Features Paperback

Notifications You must be signed in to change notification settings

eric88525/Python-tricks

Repository files navigation

Python Tricks: A Buffet of Awesome Python Features Paperback

Chapter 2

  • assert
  • context managers and with
  • underscores
  • string formatting
  • := operator
  • zen of python easter egg

Chapter 3

  • first class
  • lambda
  • decorators
  • *args and **kwargs
  • argument unpacking
  • default return

Chapter 4

  • object comparisons
  • __repr__ and __str__
  • defining exception class
  • shallow copy and deep copy
  • abstract base class
  • collections.namedtuple
  • built-in helper methods
  • class variable vs instances variable
  • instance, class, static methods

Chapter 5

  • Maps
    • dict
    • OrderedDict
    • defaultdict
    • ChainMap
    • MappingProxyType
  • Record
    • list
    • tuple
    • array.array
    • str
    • bytes
    • customized class as record
    • typing.namedTuple
    • struct.struct
    • SimpleNamespace
  • Sets and Multisets
    • set
    • frozenset
    • collections.Counter
  • Stacks
    • list
    • collections.deque
    • queue.LifoQueue
  • Queue
    • list
    • collections.deque
    • multiprocessing.Queue
  • Priority Queues
    • list
    • heapq
    • queue.PriorityQueue

Chapter 6

  • pythonic loops
  • list comprehensions
  • list slicing tricks
  • __iter__ and __next__
  • generator
  • generator expressions
  • iterator chains

Chapter 7

  • dict default value
  • sort dict
  • emulating switch case statements with dicts
  • how dict key works
  • merge dict
  • dict pretty prints

Chapter 8

  • dir() and help()
  • virtual environment
  • python bytecode and disassembler

About

Notes of Python Tricks: A Buffet of Awesome Python Features Paperback

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published