Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Function Decorators dropped when inheriting from gevent.local.local #1266
Sometime between Gevent 1.1.0 and 1.3.4, decorators on classes inheriting from gevent.local.local are dropped. In the example below, the @staticmethod decorator on the class inheriting from gevent.local.local is missing, but the class inheriting from threading.local works as expected.
import threading from gevent.local import local class ThreadingClass(threading.local): @staticmethod def test_method(*args): print(args) class GeventClass(local): @staticmethod def test_method(*args): print(args) print("Thread Local") t = ThreadingClass() print("Static:") ThreadingClass.test_method(1, 2, 3) print("Instance:") t.test_method(1, 2, 3) print() print() print("Gevent Local") g = GeventClass() print("Static:") GeventClass.test_method(1, 2, 3) print("Instance:") g.test_method(1, 2, 3)
The decorators on both ThreadingClass GeventClass work as intended when instances of each class type are created.