cool-RR / PySnooper

Never use print for debugging again
MIT License
16.34k stars 951 forks source link

Unnecessary BaseVariable type in watch? #165

Closed chen-chao closed 4 years ago

chen-chao commented 4 years ago

Is isinstance(v, BaseVariable) here really necessary? v shouldn't be an instance of BaseVariable since it has abstract methods.

https://github.com/cool-RR/PySnooper/blob/c0bf4bd0067d8d7618e40d27b2626e6f3cba4fce/pysnooper/tracer.py#L207-L213

alexmojaki commented 4 years ago

If v is an instance of a subclass of BaseVariable, isinstance(v, BaseVariable) will be True.

I'm pretty sure if you remove that check you will find some tests fail.

chen-chao commented 4 years ago

Thanks for your answer. Learned a lot from the source code.