faif / python-patterns

A collection of design patterns/idioms in Python
40.2k stars 6.93k forks source link

[Question] Why using `Type[Localizer]` instead `Localizer`? #406

Closed working12 closed 1 year ago

working12 commented 1 year ago

https://github.com/faif/python-patterns/blob/d4b7f97b3ac07cb545caca32826186e32ec1d88a/patterns/creational/factory.py#L55

In this code, why are we using Type[Localizer] instead of just using Localizer?

DKorytkin commented 1 year ago

for using Localizer instead of Type[Localizer] values of this dict must be instances