Muream / maya-stubs

Stubs for Autodesk Maya
MIT License
35 stars 4 forks source link

Many commands can take `*args: list[str] | str` but are typed with only `str` #24

Open Boon-in-Oz opened 1 month ago

Boon-in-Oz commented 1 month ago

Many commands, eg polySeparate and polyChipOff can take either a single str or a list (or Sequence?) or str representing multiple Maya objects, but the stubs currently just say *args: str.

I use those examples because I cannot tell from the documentation what *args should be in either.

polySeparate says it takes a positional arg of [poly] but I know from tests that it takes one or more str.

polyChipOff doesn't list any positional args in the signature, then says it takes a single str in the description, but shows examples with several str positional arguments.

So, yeah, I don't know how to do it but I'd love to be able to call those functions with a list and not need to add # type: ignore to my code.

Muream commented 1 month ago

Yeah that has been a pain to parse properly, most commands aren't documented in a consistent way so that's the kind of things where we'd need to handle edge cases as they come up

I haven't been super active on this in a while but if you feel like looking into this, I'd be happy to accept a PR