Skip to content

stdlib: repr of HTTPStatus, ipaddress types, Path and defaultdict is their str — no IRepr (the P11f repr channel stops at datetime/Optional) #2104

Open

Description

@antonsynd
expression Sharpy @ HEAD python3
repr(HTTPStatus.NOT_FOUND) 404 <HTTPStatus.NOT_FOUND: 404>
repr(ipaddress.ip_address("10.0.0.1")) 10.0.0.1 IPv4Address('10.0.0.1')
IPv6 ::1 ::1 IPv6Address('::1')
repr(ipaddress.ip_network("10.0.0.0/8")) 10.0.0.0/8 IPv4Network('10.0.0.0/8')
repr(pathlib.Path("a/b")) a/b PosixPath('a/b') (Sharpy: Path('a/b') per the pathlib-path-type-name deviation)
repr(defaultdict(int)) with an item defaultdict(<factory>, {'z': 2}) defaultdict(<class 'int'>, {'z': 2})

Decision 23 (plan-0ca7b7) made Sharpy.IRepr the repr channel and stamped it on Optional, Template/Interpolation, the string-enum class and the four datetime types. Every other Stdlib type whose python twin has a constructor-spelled repr needs the same rung-2 implementation; a roster test (every public Stdlib type with a python repr that differs from its str implements IRepr) keeps the class closed.


Found by /verify-implementation plan-0ca7b7 (sibling-cell probe) @ d6a7aef; pre-existing at acd1d40 unless stated. Not folded into plan-0ca7b7.

Activity

  1. antonsynd commented on Sep 30, 2026

    @antonsynd
    OwnerAuthor

    Batching 2026-09-30 @ db8e05b — charter .claude/plans/remediation-round-2026-09-20-batching.md §3.13, P11g — python-name/repr channel residue (order N5; lands alone; generator FIRST).

    Ruling R-CJ (owner, python-fidelity-scope D2 b, 2026-09-27; lettered 2026-09-30): str/repr of EVERY Stdlib type is COMPARED, one tracker per type family — every Stdlib type whose python twin has a constructor-spelled repr implements IRepr (rung 2); defaultdict keeps R-BN's placeholder factory; Path('a/b') per the pathlib-path-type-name row. Rejected: per-family promotion (leaves the repr channel half-built). One-way for printed output, counted per fixture. Contract (as P11f): every runtime spelling of a value or type — str, repr, type(x).__name__, __name__ on a reference, every message naming a type — comes from the ONE python-name/repr authority (PyFormat.PyTypeName/PyQualifiedName, IRepr, [SharpyName]). Generator FIRST: the reflective #1995 str/repr sweep becomes a python3 DIFFERENTIAL over every public Core/Stdlib type × site, allowlist ratchet; hand rows only for the user-class/dataclass/exception/function cells reflection cannot instantiate. Lands alone (printed output and, under R-DG, .expected.cs move). Lane / reach: silent-wrong · program. This issue is the class tracker for the Stdlib repr family (the generator's Stdlib column drains it). No seam hypothesis — the plan measures the seam.

  2. added
    lane:silent-wrongCompiles and runs with wrong output or semantics (rank first)
    reach:programAn ordinary program a Python programmer would write hits it
    class-trackerThe one issue per class: carries the contract and the cell table
    on Sep 30, 2026
  3. antonsynd commented on Nov 20, 2026

    @antonsynd
    OwnerAuthor

    Cell for this class: fractions.Fraction. Found by the independent review of #2781; the owner ruled on 2026-11-20 to file it.

    cell expression CPython 3.15.2 Sharpy @ 8adf932aa status
    fraction-repr repr(Fraction(1, 2)) Fraction(1, 2) 1/2 open

    Both values were measured: CPython with python3.15, Sharpy with sharpyc run built at 8adf932aa. str(Fraction(1, 2)) is 1/2 in both.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    class-trackerThe one issue per class: carries the contract and the cell tablelane:silent-wrongCompiles and runs with wrong output or semantics (rank first)reach:programAn ordinary program a Python programmer would write hits it

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions