Skip to content

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

Cleanup settings._DictProxy and scrapy.telnet (#5730)

Hanzallah Burneyf6e9e6592a28
diff --git a/scrapy/settings/__init__.py b/scrapy/settings/__init__.py
index b4e12ffdc..43ee433d1 100644
--- a/scrapy/settings/__init__.py
+++ b/scrapy/settings/__init__.py
@@ -435,30 +435,6 @@ class BaseSettings(MutableMapping):
p.text(pformat(self.copy_to_dict()))
-class _DictProxy(MutableMapping):
-
- def __init__(self, settings, priority):
- self.o = {}
- self.settings = settings
- self.priority = priority
-
- def __len__(self):
- return len(self.o)
-
- def __getitem__(self, k):
- return self.o[k]
-
- def __setitem__(self, k, v):
- self.settings.set(k, v, priority=self.priority)
- self.o[k] = v
-
- def __delitem__(self, k):
- del self.o[k]
-
- def __iter__(self, k, v):
- return iter(self.o)
-
-
class Settings(BaseSettings):
"""
This object stores Scrapy settings for the configuration of internal
diff --git a/scrapy/utils/deprecate.py b/scrapy/utils/deprecate.py
index ae727464c..a0c83f9f1 100644
--- a/scrapy/utils/deprecate.py
+++ b/scrapy/utils/deprecate.py
@@ -2,6 +2,7 @@
import warnings
import inspect
+from typing import List, Tuple
from scrapy.exceptions import ScrapyDeprecationWarning
@@ -126,9 +127,7 @@ def _clspath(cls, forced=None):
return f'{cls.__module__}.{cls.__name__}'
-DEPRECATION_RULES = [
- ('scrapy.telnet.', 'scrapy.extensions.telnet.'),
-]
+DEPRECATION_RULES: List[Tuple[str, str]] = []
def update_classpath(path):