Traceback using Gestures module
@shinyformica, thanks, I will implement this. Does this option suffer from the vanishing Gestures class?
I will also check this with an iPad.
@mikael thankfully it does not suffer from that strange vanishing-definitions thing. Though I am now locally importing objc_util anyplace I try to use ObjCInstance() or ObjCClass(), which appears to prevent it from showing up and causing trouble.
I tested the above technique using weakref to hold the reference to the Gestures object and it worked fine, so that will prevent a cyclic-reference:
self._delegate = PythonistaGestureDelegate.new() import weakref self._delegate._gestures = weakref.ref(self)
hey, have you copies objc_util and made edits? objc_util should actually never be cleared after it is loaded, so unless you are manually del'ing sys.modules['objc_util'] it should not be getting cleared out from under you. But, if you had a shadow copy on your path, it would.
import objc_util print(objc_util.__file__)
i have an older version of gestures, but i also could not reproduce your issues
@shinyformica, thanks. I will include the weakref version.
I was also wondering if you had some globals-clearing code somewhere. Remembering some previous threads where the goal was to make Pythonista act like a fresh interpreter starting every time you run a script.