Add a get_spy method.

Review Request #14606 — Created Sept. 10, 2025 and updated

Information

kgb
master

Reviewers

kgb

Type checkers don't particularly like it when accessing data on a method
which is provided by the spy, since they don't know that kgb has
replaced the callable. This method can be used with the spied-on method
to retrieve the spy in a way which does not get flagged by typing.

Used this in some code and saw that the resulting checks were no longer
showing warnings in my editor.

Summary ID
Add a get_spy method.
Type checkers don't particularly like it when accessing data on a method which is provided by the spy, since they don't know that kgb has replaced the callable. This method can be used with the spied-on method to retrieve the spy in a way which does not get flagged by typing. Testing Done: Used this in some code and saw that the resulting checks were no longer showing warnings in my editor.
omuuzqmmvopoxrmzxxlsxlnursuqzlkk
Checks run (2 succeeded)
flake8 passed.
JSHint passed.