faif / python-patterns

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

observer.py imports typing.Protocol which is not in Python 3.7 #369

Closed yhay81 closed 3 years ago

yhay81 commented 3 years ago

I got an error when I run tox E ImportError: cannot import name 'Protocol' from 'typing' (/Users/yhay81/.pyenv/versions/3.7.9/lib/python3.7/typing.py)

It is because observer.py import typing.Progocol and typing.Progocol is new in Python version 3.8. https://docs.python.org/3/library/typing.html#typing.Protocol (It is from #345)

I think this is one of a solution.

I can make PR if this is okay.

yhay81 commented 3 years ago

I dropped testing 3.7 in tox: #372 If it is okay that this repo do not support 3.7, I think this issue can be closed.

faif commented 3 years ago

Yeah, that's fine. In general it's good to keep up with the latest minor version + 1 or more minor older versions, but we don't need to support all of them.