@@ -26,25 +26,25 @@ class _MethodInfo(NamedTuple):
2626
2727
2828def functools_total_ordering_maker_callback (ctx : mypy .plugin .ClassDefContext ,
29- auto_attribs_default : bool = False ) -> None :
29+ auto_attribs_default : bool = False ) -> bool :
3030 """Add dunder methods to classes decorated with functools.total_ordering."""
3131 if ctx .api .options .python_version < (3 ,):
3232 # This plugin is not supported in Python 2 mode (it's a no-op).
33- return
33+ return True
3434
3535 comparison_methods = _analyze_class (ctx )
3636 if not comparison_methods :
3737 ctx .api .fail (
3838 'No ordering operation defined when using "functools.total_ordering": < > <= >=' ,
3939 ctx .reason )
40- return
40+ return True
4141
4242 # prefer __lt__ to __le__ to __gt__ to __ge__
4343 root = max (comparison_methods , key = lambda k : (comparison_methods [k ] is None , k ))
4444 root_method = comparison_methods [root ]
4545 if not root_method :
4646 # None of the defined comparison methods can be analysed
47- return
47+ return True
4848
4949 other_type = _find_other_type (root_method )
5050 bool_type = ctx .api .named_type ('builtins.bool' )
@@ -61,6 +61,8 @@ def functools_total_ordering_maker_callback(ctx: mypy.plugin.ClassDefContext,
6161 args = [Argument (Var ('other' , other_type ), other_type , None , ARG_POS )]
6262 add_method_to_class (ctx .api , ctx .cls , additional_op , args , ret_type )
6363
64+ return True
65+
6466
6567def _find_other_type (method : _MethodInfo ) -> Type :
6668 """Find the type of the ``other`` argument in a comparison method."""
0 commit comments