MCPcopy
hub / github.com/scrapy/scrapy / copy_to_dict

Method copy_to_dict

scrapy/settings/__init__.py:671–685  ·  view source on GitHub ↗

Make a copy of current settings and convert to a dict. This method returns a new dict populated with the same values and their priorities as the current settings. Modifications to the returned dict won't be reflected on the original settings. This

(self)

Source from the content-addressed store, hash-verified

669 )
670
671 def copy_to_dict(self) -> dict[_SettingsKey, Any]:
672 """
673 Make a copy of current settings and convert to a dict.
674
675 This method returns a new dict populated with the same values
676 and their priorities as the current settings.
677
678 Modifications to the returned dict won't be reflected on the original
679 settings.
680
681 This method can be useful for example for printing settings
682 in Scrapy shell.
683 """
684 settings = self.copy()
685 return settings._to_dict()
686
687 # https://ipython.readthedocs.io/en/stable/config/integrating.html#pretty-printing
688 def _repr_pretty_(self, p: Any, cycle: bool) -> None:

Callers 3

_repr_pretty_Method · 0.95
test_copy_to_dictMethod · 0.95
runMethod · 0.80

Calls 2

copyMethod · 0.95
_to_dictMethod · 0.80

Tested by 1

test_copy_to_dictMethod · 0.76