CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-wtfpython

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

93

1.05x
Quality

Pending

Does it follow best practices?

Impact

93%

1.05x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-1/

{
  "context": "This criteria evaluates how well the engineer uses Python's descriptor protocol (__get__ method) to implement method tracking functionality. The focus is on proper implementation of the descriptor protocol to create bound methods that wrap original methods while maintaining correct binding behavior.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Implements __get__ method",
      "description": "The TrackedMethod class implements the __get__ method that is part of Python's descriptor protocol",
      "max_score": 30
    },
    {
      "name": "Returns bound callable",
      "description": "The __get__ method returns a callable that is properly bound to the instance (handles instance parameter correctly)",
      "max_score": 25
    },
    {
      "name": "Handles None instance",
      "description": "The __get__ method handles the case when instance is None (accessed on class rather than instance) by returning self or the original method",
      "max_score": 15
    },
    {
      "name": "Wraps original method",
      "description": "The implementation stores and calls the original method, preserving its functionality",
      "max_score": 15
    },
    {
      "name": "Records call information",
      "description": "The bound callable records args and kwargs for each invocation in the instance's calls list",
      "max_score": 10
    },
    {
      "name": "Preserves return values",
      "description": "The wrapped method returns the same value as the original method would return",
      "max_score": 5
    }
  ]
}

tile.json