MCPcopy Index your code
hub / github.com/python/mypy / encode_optional_str

Function encode_optional_str

mypy/server/astdiff.py:353–357  ·  view source on GitHub ↗
(s: str | None)

Source from the content-addressed store, hash-verified

351
352
353def encode_optional_str(s: str | None) -> str:
354 if s is None:
355 return "<None>"
356 else:
357 return s
358
359
360class SnapshotTypeVisitor(TypeVisitor[SnapshotItem]):

Callers 3

visit_instanceMethod · 0.85
visit_parametersMethod · 0.85
visit_callable_typeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…