CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-wtfpython

Educational collection of surprising Python code snippets that demonstrate counter-intuitive behaviors and language internals

Overall
score

93%

Overview
Eval results
Files

rubric.jsonevals/scenario-9/

{
  "context": "This evaluation assesses how well the engineer understands and uses Python's Unicode character handling capabilities to detect lookalike characters. The focus is on proper usage of Unicode code point detection, character comparison, and the unicodedata module for analyzing character properties.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Unicode code point extraction",
      "description": "Uses ord() or similar method to obtain numeric Unicode code points from characters for comparison and reporting",
      "max_score": 20
    },
    {
      "name": "Code point formatting",
      "description": "Correctly formats code points as Unicode notation (e.g., 'U+04BB') using string formatting with hex conversion",
      "max_score": 15
    },
    {
      "name": "ASCII range detection",
      "description": "Properly identifies ASCII characters by checking if code points fall within the ASCII range (0-127 or using isascii())",
      "max_score": 20
    },
    {
      "name": "Lookalike mapping",
      "description": "Implements a mapping or comparison mechanism to identify which ASCII characters the Unicode lookalikes resemble (e.g., Cyrillic 'е' U+0435 resembles ASCII 'e', Cyrillic 'һ' U+04BB resembles ASCII 'h')",
      "max_score": 25
    },
    {
      "name": "Character position tracking",
      "description": "Tracks and reports the position of suspicious characters within the identifier string using enumerate() or index tracking",
      "max_score": 10
    },
    {
      "name": "Risk classification logic",
      "description": "Implements correct logic to classify identifiers into 'safe' (all ASCII), 'suspicious' (contains lookalikes), or 'mixed' (non-ASCII without visual confusion) categories",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-wtfpython

tile.json