lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

python: EventLog accept pathlib.Path #468

Closed judfs closed 9 months ago

judfs commented 9 months ago

pathlib was introduced in 3.4 (2014). Could also add the type hint typing.Union[str, bytes, os.PathLike]. PathLike is from py 3.6 (2016)

judfs commented 9 months ago

I've found that if sys.version_info >= (3, 6): is preferred by pylance over try:.

What is the target supported versions? Do you want 3.3 to still work?

nosracd commented 9 months ago

I've found that if sys.version_info >= (3, 6): is preferred by pylance over try:.

I agree; that's a better way to do it

What is the target supported versions? Do you want 3.3 to still work?

That's a bit tricky. In the last release we dropped Python 2 support but we haven't declared a minimum version of Python 3. So right now it's just "as old as is reasonably convenient to support".

judfs commented 9 months ago

I assume this works, but I've not tested with older versions

judfs commented 9 months ago

I'm fine with as it is. It doesn't add much value but first commit doesn't have the type hint.

Readme should probably spell out Python >= 3.6 is supported. Somewhere it might be nice to enumerate everything LCM 1.4 supported as well.