requirements-parser icon indicating copy to clipboard operation
requirements-parser copied to clipboard

Type members of Requirement as Optional

Open jenshnielsen opened this issue 3 years ago • 2 comments

This both gives better types for end users of the class as all the members previously inferred as NoneType and allows us to remove a significant amount of ignore comments.

We ran into this issue in https://github.com/QCoDeS/Qcodes/pull/3848 where we expect the name to be a str but the type is inferred as None

In that code we are using Requirement.name which has a type of None in 0.4.0 and 0.5.0

With some rearranging of the code it may be possible to remove the optional from some of the members but for now this makes the types more correct.

jenshnielsen avatar Jan 21 '22 12:01 jenshnielsen

Hi @jenshnielsen - thanks for the PR - can you please look to address the failing checks?

madpah avatar Jan 24 '22 10:01 madpah

Not sure where that import came from must have been a "helpful" ide importing an incomplete symbol should be fixed now

jenshnielsen avatar Jan 24 '22 11:01 jenshnielsen