Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Protocol to factory pattern #402

Closed
mfurquimdev opened this issue Jan 19, 2023 · 1 comment 路 Fixed by #403
Closed

Add Protocol to factory pattern #402

mfurquimdev opened this issue Jan 19, 2023 · 1 comment 路 Fixed by #403

Comments

@mfurquimdev
Copy link

mfurquimdev commented Jan 19, 2023

Hi 馃憢馃徑

I see we have some type hints that's been continuously added as mentioned at #373.

As the factory pattern has the constrain of both classes having to implement a localize method, I thought it might be a good idea to reinforce this constrain by using Protocol.

I'd gladly implement this if it's okay.

Here's the PEP-0544 and the Python docs for Protocols.

@faif
Copy link
Owner

faif commented Jan 20, 2023

Hi,

Sure, go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants