tessl install tessl/pypi-wtfpython@3.0.0Educational collection of surprising Python code snippets that demonstrate counter-intuitive behaviors and language internals
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.06x
Baseline
Agent success rate without this tile
88%
{
"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
}
]
}