LINUX.ORG.RU

История изменений

Исправление twinpeaks, (текущая версия) :

anonymous-angler ★ (21.11.21 16:40:46)

что ты называешь ABC контрактами, мне так и не удалось нагуглить

В одной из первых же ссылок на запрос в Гугле:

abc python contracts

https://stackoverflow.com/questions/3570796/why-use-abstract-base-classes-in-python

Short version

ABCs offer a higher level of semantic contract between clients and the implemented classes.

Long version

There is a contract between a class and its callers. The class promises to do certain things and have certain properties. There are different levels to the contract. At a very low level, the contract might include the name of a method or its number of parameters. In a staticly-typed language, that contract would actually be enforced by the compiler. In Python, you can use EAFP or type introspection to confirm that the unknown object meets this expected contract.

Так что, привел что я имею ввиду под «abc» в своем сообщении.

anonymous-angler ★ (21.11.21 16:40:46)

GIL же

Для Python v3.8+ (привет PEP554) с asyncio уже не такая проблема этот GIL, вроде.

Исправление twinpeaks, :

anonymous-angler ★ (21.11.21 16:40:46) ты называешь ABC контрактами

В одной из первых же ссылок на запрос в Гугле:

abc python contracts

https://stackoverflow.com/questions/3570796/why-use-abstract-base-classes-in-python

Short version

ABCs offer a higher level of semantic contract between clients and the implemented classes.

Long version

There is a contract between a class and its callers. The class promises to do certain things and have certain properties. There are different levels to the contract. At a very low level, the contract might include the name of a method or its number of parameters. In a staticly-typed language, that contract would actually be enforced by the compiler. In Python, you can use EAFP or type introspection to confirm that the unknown object meets this expected contract.

Так что, привел что я имею ввиду под «abc» в своем сообщении.

anonymous-angler ★ (21.11.21 16:40:46) GIL же.

Для Python v3.8+ (привет PEP554) с asyncio уже не такая проблема этот GIL, вроде.

Исходная версия twinpeaks, :

anonymous-angler ★ (21.11.21 16:40:46) ты называешь ABC контрактами

В одной из первых же ссылок на запрос в Гугле:

abc python contracts

https://stackoverflow.com/questions/3570796/why-use-abstract-base-classes-in-python

Short version

ABCs offer a higher level of semantic contract between clients and the implemented classes.

Long version

There is a contract between a class and its callers. The class promises to do certain things and have certain properties.

There are different levels to the contract. At a very low level, the contract might include the name of a method or its number of parameters. In a staticly-typed language, that contract would actually be enforced by the compiler. In Python, you can use EAFP or type introspection to confirm that the unknown object meets this expected contract.

anonymous-angler ★ (21.11.21 16:40:46) GIL же.

Для Python v3.8+ (привет PEP554) с asyncio уже не такая проблема этот GIL, вроде.