class Test(object):
crawlers = property(
lambda self: self.tt,
doc="Set of :class:`crawlers <scrapy.crawler.Crawler>` started by "
":meth:`crawl` and managed by this class."
)
def __init__(self):
self.tt = set()
def runt(self):
self.crawlers.add("11")
if __name__ == "__main__":
t = Test()
t.runt()
print(t.crawlers)
网友评论