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)
: ReturnTrue
ifclass
is a subclass (direct, indirect or virtual) ofclassinfo
. A class is considered a subclass of itself.classinfo
may be a tuple of class objects, in which case every entry inclassinfo
will be checked. In any other case, aTypeError
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 theClass
and theClass
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, otherwiseAttributeError
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.