introspection tag

3 questions


1 answers
113 views
0
To output variables & properties for an object

Does Python have a function like print_r of PHP?I have to see the status of the object when I debug it.Is there a similar function?


1 answers
92 views
0
Find the class name from the instance

Is there a way to find out the class name of the instance in Python?I thought I could use the inspect module, but I couldn't find it.


1 answers
128 views
0
To have a function output its own name without a traceback module

How do you get a function to output its own name without a traceback module?For example, when the module foo has a bar function, in foo.bar() you would like to print bar is your name bar or foo.bar.Wh...


© 2024 OneMinuteCode. All rights reserved.