Modify rule S935: fix typo (#3893)

This commit is contained in:
Ghislain Piot 2024-04-18 15:24:22 +02:00 committed by GitHub
parent b64b26b71a
commit 2a35b19260
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@ This rule raises an issue when a special method returns an object of an unexpect
== Why is this an issue?
Python allows developers to customize how code is interpreted by defining special methods (also called magic methods). For example, it is possible to define the objects own truthiness or falsiness by iverriding ``++__bool__++`` method. It is invoked when the built-in ``++bool()++`` function is called on an object. The ``++bool()++`` function returns ``++True++`` or ``++False++`` based on the truth value of the object.
Python allows developers to customize how code is interpreted by defining special methods (also called magic methods). For example, it is possible to define an object's own truthiness or falsiness by overriding ``++__bool__++`` method. It is invoked when the built-in ``++bool()++`` function is called on the object. The ``++bool()++`` function returns ``++True++`` or ``++False++`` based on the truth value of the object.
The Python interpreter will call these methods when performing the operation they're associated with. Each special method expects a specific return type. Calls to a special method will throw a ``++TypeError++`` if its return type is incorrect.