* Implement property.__name__ attribute
Add getter and setter for the __name__ attribute on property objects.
The getter returns the explicitly set name if available, otherwise
falls back to the getter function's __name__. Raises AttributeError
if no name is available, matching CPython 3.13 behavior.
The implementation handles edge cases:
- Returns None when explicitly set to None
- Propagates non-AttributeError exceptions from getter's __getattr__
- Raises property-specific AttributeError when getter lacks __name__
This fix enables test_property_name in test_property.py to pass.
* Refactor to use get_property_name in __name__ implementation
Consolidate duplicate logic by making name_getter() use the existing
get_property_name() helper method. This eliminates code duplication
and improves maintainability.
Changes:
- Update get_property_name() to return PyResult<Option<PyObjectRef>>
to properly handle and propagate non-AttributeError exceptions
- Simplify name_getter() to delegate to get_property_name()
- Update format_property_error() to handle the new return type
This addresses review feedback about the relationship between
get_property_name() and __name__ implementation.
* style comment
Validate that the handler argument passed to codecs.register_error
is callable, raising TypeError with message 'handler must be callable'
if it is not. This matches CPython behavior.
This fix enables test_badregistercall in test_codeccallbacks.py to pass.
* Resolve number slots via MRO in PyNumber and operator, ensure inherited and dynamically added methods are found.
Use class().mro_find_map() to mimic the same behaviour as CPython.
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
* CTRL+Z then Enter will now close shell on Windows.
* Additional comment.
* Use EOF const
* Add cfg(windows) for EOF_CHAR
---------
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
* Update ruff to 0.14.1
* Fix test regression in `test_compile`
* Unmark passing test
* Update `test_syntax` from 3.13.9
---------
Co-authored-by: Noa <coolreader18@gmail.com>
* avoid get_class_attr for __hash__; read hash slot via mro_find_map
Reduce calls and lock acquisitions on hot paths by bypassing get_class_attr(__hash__) and directly resolving the hash implementation with mro_find_map(|cls| cls.slots.hash.load()).
* fix linting in hash function