python-trio / trio-typing

Type hints for Trio and related projects
Other
27 stars 16 forks source link

[outcome] Add support for type checking match #70

Closed VincentVanlaer closed 1 year ago

VincentVanlaer commented 1 year ago

attrs provides __match_args__ automatically, so these only need to be added to the stubs.

Note: this is only the case since attrs 21.3.0. Should we then also bump the required attrs version in outcome to 21.3.0?

A5rocks commented 1 year ago

Unfortunately I don't know the history of this code -- is there a reason why the stubs aren't just importing attr and using it? That would solve the attrs versioning problem at least and offer more complete stubs.

VincentVanlaer commented 1 year ago

Perhaps it would be better to apply the stubs to the outcome repo. Especially since the stubs are only 55 lines.

oremanj commented 1 year ago

I'll take this for now and we can pursue upstreaming the stubs to outcome under separate cover. I think when I first wrote trio-typing there wasn't good type checker support for attrs classes.