I've begun trying to add type hints to avro/lang/py3. This is uncovering a
lot of variance problems in the current implementation. I need some advice
and guidance.

For example, class Schema has a constructor like

  def __init__(
      self,
      type: str,
      other_props: typing.Optional[typing.Dict[str, typing.Any]]=None
  ) -> None:

but most of its subclasses don't have type in their constructors at all,
much less require it. It's not possible to make the type checker happy
without fixing all these problems, but fixing the problems is a big
departure from merely adding the type hints. It would require careful
planning as it will certainly change some of the signatures of these
methods. (You could think of it as compatibility changes, or maybe just
recognizing inconsistencies that exist today.) Also, opening individual
bugs for everything I find might be discouraging, and they'll overlap a lot.

I'd like to continue working on the type hints and let mypy complain about
the things it finds, first, and then once we have the type hints somewhat
in place and merged in, including running them in build.sh, then I'd like
to pursue fixing the problems.

What do you think? Is that a good approach, or should I try a different
tactic?

Reply via email to