0
my_object = instance_from_external_module
my_object.prop = 2  # "..." has no attribute "prop"

How can I make MyPy accept a monkeypatch without raising an error in every single file of a large project where the object and that property are used?

I can't subclass whatever class the object is an instance of, because the object is complex and goes through a lot of third-party processing before being called.

Laurent
  • 12,287
  • 7
  • 21
  • 37
Some Guy
  • 576
  • 1
  • 4
  • 17

0 Answers0