Skip to content
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lecture10
lecture2
lecture3
lecture5
lecture6
lecture7
lecture8
.gitignore
README.md

README.md

CSCentre_Python

This is a small how-to collection of basic Python code snippets. The code follows the lecture series by CSC course "Python programming" (fall 2015) by S. Lebedev (https://compscicenter.ru/courses/python/2015-autumn/classes/)

Content:

Lecture 2.

  • Minimum function and fabric pattern
  • Local, nonlocal and global objects
  • Unpacking
  • Functional aspects

Lecture 3. Decorators and functools

  • Decorator examples
  • Decorator with positional and kw-only arguments
  • Functools module: lru_cache, single_dispatch

Lecture 5. Collections

  • Tuples and Namedtuples
  • Lists and deque
  • Dicts, DefaultDicts, OrderedDicts
  • Counters

Lecture 6. Classes (Part 1)

  • Useful class decorators (singleton, deprecated)
  • Mixin classes
  • Magic methods

Lecture 7. Exceptions and Context managers

  • Exceptions basic: try / except / else / finally
  • Context Managers
  • contextlib

Lecture 8. Iterators, generators and contextlibs

  • Iterators, binary tree
  • Generators: yield, send, throw, yield from, return
  • Generators as iterators, coroutines, compact context managers
  • itertools

Lecture 10. Classes (Part 2)

  • Descriptors: get, set, delete
  • Data and non-data descriptors, cached_property
  • property, staticmethod and classmethod
  • Metaclasses, new
  • ABC and abstractmethod, collections.abc
You can’t perform that action at this time.