Skip to content

Examples needed to reach 100% depyler compilation rate #4

Description

@noahgift

Current Status

  • 38.3% compilation rate (79/206 examples)
  • 4400+ compilation errors remaining

Error Distribution

Error Count Root Cause
E0308 1439 Type mismatches (serde_json::Value fallback)
E0599 596 Method not found on wrong types
E0277 510 Trait not implemented
E0609 477 Field access on Args (subcommand fields)
E0425 416 Undefined variables (block scoping)
E0282 183 Type inference failed
E0412 169 Undefined type

Suggested New Examples

1. Simple subcommand patterns (E0609 fix validation)

example_subcommand_simple/
  - Single subcommand with 1 positional arg
  - Handler function accesses args.field directly

2. Block scoping patterns (E0425 fix validation)

example_walrus_operator/
  - if (x := func()): use x
  - Walrus in while loops
  - Walrus in comprehensions

3. Type inference edge cases (E0308/E0282)

example_dict_typed/
  - Dict with explicit type hints: Dict[str, int]
  - Nested dicts with types
  
example_list_typed/
  - List with type hints: List[str]
  - List comprehension with typed output

4. Minimal stdlib examples (module mapping)

example_datetime_simple/
  - Just date parsing and formatting
  - No timedelta operations

example_pathlib_simple/
  - Path.exists(), Path.is_file()
  - No complex operations

example_json_typed/
  - json.loads with type annotation
  - json.dumps with simple dict

5. CLI patterns that currently fail

example_argparse_minimal/
  - Single positional, single optional
  - No subcommands
  - Minimal handler

example_argparse_types/
  - type=int, type=float explicit
  - choices parameter
  - nargs="+" with typed list

6. Control flow edge cases

example_try_except_typed/
  - try/except with typed exception
  - Multiple except handlers

example_match_simple/
  - Python 3.10+ match statement
  - Simple patterns only

Priority Order

  1. example_subcommand_simple - validates E0609 fix (477 errors)
  2. example_walrus_operator - validates E0425 fix (416 errors)
  3. example_dict_typed - validates type inference (1439 errors)
  4. example_argparse_minimal - baseline CLI that must work

Notes

These examples should be:

  • Minimal (< 50 lines Python)
  • Single-purpose (test one pattern)
  • Have passing Python tests
  • Be realistic CLI use cases

Refs: DEPYLER-0606, DEPYLER-0607

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions