MCPcopy Index your code
hub / github.com/RustPython/RustPython / copy_with

Method copy_with

Lib/_colorize.py:222–240  ·  view source on GitHub ↗

Return a new Theme based on this instance with some sections replaced. Themes are immutable to protect against accidental modifications that could lead to invalid terminal states.

(
        self,
        *,
        argparse: Argparse | None = None,
        syntax: Syntax | None = None,
        traceback: Traceback | None = None,
        unittest: Unittest | None = None,
    )

Source from the content-addressed store, hash-verified

220 unittest: Unittest = field(default_factory=Unittest)
221
222 def copy_with(
223 self,
224 *,
225 argparse: Argparse | None = None,
226 syntax: Syntax | None = None,
227 traceback: Traceback | None = None,
228 unittest: Unittest | None = None,
229 ) -> Self:
230 """Return a new Theme based on this instance with some sections replaced.
231
232 Themes are immutable to protect against accidental modifications that
233 could lead to invalid terminal states.
234 """
235 return type(self)(
236 argparse=argparse or self.argparse,
237 syntax=syntax or self.syntax,
238 traceback=traceback or self.traceback,
239 unittest=unittest or self.unittest,
240 )
241
242 @classmethod
243 def no_colors(cls) -> Self:

Callers 1

test_copy_withMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_copy_withMethod · 0.76