Replies: 2 comments
-
@msmftc, thanks for raising this. In general, the goal of |
Beta Was this translation helpful? Give feedback.
-
Note: this has been addressed in the 0.8.1 release |
Beta Was this translation helpful? Give feedback.
-
@mballance,
In my application I need some introspection on classes that are decorated with
@vsc.randoj
. Given a reference to such a class, I need to determine the module that the class was defined in. The class property__module__
typically has this information, but decorating the class changes__module__
tovsc.rand_obj
Based on advice I found on the internet, I tried adding a
@functools.wraps
decorator inside the functionvsc.randobj()
, but that did not help. The only solution that I've found is to add a new line of code tovsc.randobj()
that stores the original module name in a new property, as shown here:This lets me read the original module name, as shown in the example below, but I'd rather not use a hacked version of PyVSC. Do you know how I can read the original module using the current PyVSC code? If not, then can you think of a simple PyVSC change that would permit introspection of decorated classes?
In this example, the original module name is
__main__
for bothHelloClass
andSelector
:Beta Was this translation helpful? Give feedback.
All reactions