Skip to content

32nd Week of 2021

Computer Science

Programming

Basics

  • New: Add datetime.timestamp() method.
  • New: Change function default argument.
  • New: Filter function.
  • New: Dict.setdefault.

    setdefault(key[, default]): If key is in the dictionary, return its value. If not, insert key with a value of default and return default. default defaults to None.

  • New: F-strings.

FastAPI

  • New: HTTP API from Python type hints.

    FastAPI is a modern, fast (high-performance), web framework for building HTTP APIs based on standard Python type hints.

  • New: Add route to other module functions.

    There are two main ways of using this module, with the decorator @app.get("{{route}}") or with FastAPI().add_route("{{route}}", {{function}}).

    The first alternative is by far the most common, but if you want to separate the functions from the HTTP API entrypoint, you have to use the second option.

    The advantage of this alternative is that we can import the function from another module.

pytest

  • New: Parametrization.
  • New: How to invoke pytest.

    Invoke with python -m pytest so that the current directory is included to the python path.

  • New: Execute just one test or test class.

statsmodels

  • New: Linear regression tutorial.