Returns value in spider_closed signal in scrapy
<p>I have a spider and I need to return the length of a list inside this spider when finished.</p>

<pre><code>class MySpider(scrapy.Spider):
    def __init__(self):
        self.my_list = []

    def parse(self, response):
        # parse values and save in the list
        self.my_list.append(something)

    def closed(self, reason):
        # here I need to return len(self.my_list)
        print len(self.my_list)
</code></pre>

<p>I tried yield and return, both without success.</p>