Skip to content

34th Week of 2021

Computer Science

GNULinux

Alacritty

  • New: Alacritty.

    alacritty/alacritty is a cross-platform, OpenGL terminal emulator.

  • New: Shortcuts.

    • Ctrl+Shift+Space: Enter vi mode.
  • New: Interactive functionality SSH.

Programming

Basics

  • New: Issubclass.

    issubclass(class, classinfo): Return True if class is a subclass (direct, indirect or virtual) of classinfo. A class is considered a subclass of itself. classinfo may be a tuple of class objects, in which case every entry in classinfo will be checked. In any other case, a TypeError exception is raised.

FastAPI

  • Improvement: Wrapping imported functions.
  • New: Dependency injection.

    A FastAPI decorated function can import the necessary arguments for other functions or objects.

  • New: Default JSON encoder.

    The default the responses will be serialized to JSON. You can use a different JSON encoder than the default one, for example ijl/orjson which is more efficient and natively support serialization of dataclasses and more.

Typing

  • New: Type.

    • Type[Class]: Accepts instances of the Class and the Class itself.

unittest

  • New: Python unittest and unittest.mock.

    The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework.

    unittest.mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.

Other

  • New: Getattr.

    getattr(object, name[, default])
    

    Return the value of the named attribute of object.name must be a string. If the string is the name of one of the object's attributes, the result is the value of that attribute. If the named attribute does not exist, default is returned if provided, otherwise AttributeError is raised.

  • New: Weekdays enum.

    Weekdays = IntEnum(
        "Weekdays",
        "Monday Tuesday Wednesday Thursday Friday Saturday Sunday",
        start=0,
    )
    
  • New: Str.strip().

    • str.strip([chars]): Return a copy of the string with the leading and trailing characters removed.