Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

added __slots__ to decrease memory footprint of Link objects

Pablo Hoffman5028146e8c2d
diff --git a/scrapy/trunk/scrapy/link/__init__.py b/scrapy/trunk/scrapy/link/__init__.py
index e80b20122..13ec4243d 100644
--- a/scrapy/trunk/scrapy/link/__init__.py
+++ b/scrapy/trunk/scrapy/link/__init__.py
@@ -77,6 +77,9 @@ class Link(object):
Link objects represent an extracted link by the LinkExtractor.
At the moment, it contains just the url and link text.
"""
+
+ __slots__ = 'url', 'text'
+
def __init__(self, url, text=''):
self.url = url
self.text = text