File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Provide functions to add/find contract checkers."""
2+
23import contextvars
34import functools
45import inspect
@@ -1289,15 +1290,21 @@ def add_invariant_checks(cls: ClassT) -> None:
12891290
12901291 for name , prop in names_properties :
12911292 new_prop = property (
1292- fget = _decorate_with_invariants (func = prop .fget , is_init = False )
1293- if prop .fget
1294- else None ,
1295- fset = _decorate_with_invariants (func = prop .fset , is_init = False )
1296- if prop .fset
1297- else None ,
1298- fdel = _decorate_with_invariants (func = prop .fdel , is_init = False )
1299- if prop .fdel
1300- else None ,
1293+ fget = (
1294+ _decorate_with_invariants (func = prop .fget , is_init = False )
1295+ if prop .fget
1296+ else None
1297+ ),
1298+ fset = (
1299+ _decorate_with_invariants (func = prop .fset , is_init = False )
1300+ if prop .fset
1301+ else None
1302+ ),
1303+ fdel = (
1304+ _decorate_with_invariants (func = prop .fdel , is_init = False )
1305+ if prop .fdel
1306+ else None
1307+ ),
13011308 doc = prop .__doc__ ,
13021309 )
13031310 setattr (cls , name , new_prop )
Original file line number Diff line number Diff line change 11"""Define public decorators."""
2+
23import inspect
34import reprlib
45import traceback
Original file line number Diff line number Diff line change 11"""Define the metaclass necessary to inherit the contracts from the base classes."""
2+
23import abc
34import inspect
45import sys
Original file line number Diff line number Diff line change 11"""Handle representations necessary for informative error messages."""
2+
23import ast
34import inspect
45import re
@@ -405,7 +406,7 @@ def find_lambda_condition(
405406
406407
407408def inspect_lambda_condition (
408- condition : Callable [..., Any ]
409+ condition : Callable [..., Any ],
409410) -> Optional [ConditionLambdaInspection ]:
410411 """
411412 Try to extract the source code of the condition as lambda.
Original file line number Diff line number Diff line change 11"""Define data structures shared among the modules."""
2+
23import enum
34import inspect
45import reprlib
Original file line number Diff line number Diff line change 44https://packaging.python.org/en/latest/distributing.html
55https://github.com/pypa/sampleproject
66"""
7+
78import os
89import sys
910
6768 "astor==0.8.1" ,
6869 "numpy>=1,<2" ,
6970 'mypy==1.5.1;python_version>="3.8"' ,
70- 'black==23 .9.1 ;python_version>="3.8"' ,
71+ 'black==25 .9.0 ;python_version>="3.8"' ,
7172 'deal>=4,<5;python_version>="3.8"' ,
7273 'asyncstdlib==3.9.1;python_version>="3.8"' ,
7374 ]
Original file line number Diff line number Diff line change 11"""Provide mock structures used accross the tests."""
2+
23from typing import List , Union
34
45
You can’t perform that action at this time.
0 commit comments