Giter Site home page Giter Site logo

Comments (3)

cool-RR avatar cool-RR commented on May 14, 2024

from pysnooper.

rtphokie avatar rtphokie commented on May 14, 2024

That's what the variables argument is for. Also, if the classes' repr uses these attributes, they'll show up even if they aren't included in variables .

On Mon, Apr 22, 2019, 16:23 Tony Rice @.***> wrote: Consider this code: class Foo(): def init(self): self.a = 1 self.b = 2 self.c = None @pysnooper.snoop() def myfunc(self): localvar = 5 localvar += 1 self.c = self.b + self.a pysnooper's output when calling myfunc: Starting var:.. self = <snooptest.Foo instance at 0x1052c5b90> 08:50:38.552499 call 16 @pysnooper.snoop() 08:50:38.553309 line 18 localvar = 5 New var:....... localvar = 5 08:50:38.553382 line 19 localvar += 1 Modified var:.. localvar = 6 08:50:38.553457 line 20 self.c = self.b + self.a 08:50:38.553560 return 20 self.c = self.b + self.a The values of self.a, self.b, and self.c are not shown by pysnooper but are the primary purpose of this method. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#7>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAN3SRLATTZU5LTBC6HLIDPRW343ANCNFSM4HHPVXXQ .

But doesn't that defeat the purpose of this easy to use debugging decorator? Having to specify which variables you want to be instrumented?

from pysnooper.

cool-RR avatar cool-RR commented on May 14, 2024

from pysnooper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.