Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2
Revisão | f2e58889ca6219ea8afe1b566204ae1b48d4f64c (tree) |
---|---|
Hora | 2023-10-04 01:41:46 |
Autor | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
@@ -20,3 +20,4 @@ | ||
20 | 20 | .mypy_cache |
21 | 21 | TestDoubles/_generated/ |
22 | 22 | |
23 | +html |
@@ -1,7 +1,5 @@ | ||
1 | 1 | # (C) Albert Mietus, 2022, 2023. Part of Castle/CCastle project |
2 | - | |
3 | - | |
4 | -import logging; logger = logging.getLogger(__name__) | |
2 | +import logging; logger = logging.getLogger(__name__) # pragma: no mutate | |
5 | 3 | |
6 | 4 | from .CCbase import * |
7 | 5 | from castle.auxiliary.pack import mk_tuple |
@@ -30,7 +28,7 @@ | ||
30 | 28 | return count |
31 | 29 | |
32 | 30 | def find_port_by_name(self, name:str) -> CC_Port: |
33 | - return next(p for p in self.ports if p.name==name) | |
31 | + return next(p for p in self.ports if p.name==name) # pragma: no mutate (OLD) | |
34 | 32 | |
35 | 33 | def render(self, prepend:str="", indent:str=" ") ->str: |
36 | 34 | return ( |
@@ -19,7 +19,7 @@ | ||
19 | 19 | type: type |
20 | 20 | |
21 | 21 | |
22 | -CC_TypedParameterTuple: TypeAlias = Sequence[CC_TypedParameter] | |
22 | +CC_TypedParameterTuple: TypeAlias = Sequence[CC_TypedParameter] # pragma: no mutate (OLD) | |
23 | 23 | |
24 | 24 | class CC_PortDirection(Enum): |
25 | 25 | CC_B_PortDirectionIs_UNKNOWN = Unknown = 0 |
@@ -40,7 +40,7 @@ | ||
40 | 40 | type: type |
41 | 41 | |
42 | 42 | def isInPort(self): |
43 | - return self.direction in (CC_PortDirection.In, CC_PortDirection.BiDir) | |
43 | + return self.direction in (CC_PortDirection.In, CC_PortDirection.BiDir) # pragma: no mutate (OLD) | |
44 | 44 | def portray_name(self) ->str: ### <port name> |
45 | 45 | return f'{self.name}' |
46 | 46 |
@@ -52,7 +52,7 @@ | ||
52 | 52 | else: |
53 | 53 | from warnings import warn |
54 | 54 | tn = self.type if isinstance(self.type, str) else self.type.__name__ |
55 | - warn(f"Using string (or other non CC_Base types) port.types (for >>{tn}<<) is not wise", DeprecationWarning, stacklevel=2) | |
55 | + warn(f"Using string (or other non CC_Base types) port.types (for >>{tn}<<) is not wise", DeprecationWarning, stacklevel=2) # pragma: no mutate (OLD) | |
56 | 56 | return f'&cc_P_{tn}' |
57 | 57 | |
58 | 58 |
@@ -60,11 +60,11 @@ | ||
60 | 60 | class CC_Function(ABCD, CC_Base): # ABC |
61 | 61 | name: str |
62 | 62 | _ : KW_ONLY |
63 | - type: type=None # the return type of the callable | |
64 | - body=None # XXX Add the (AST of the) body LATER | |
63 | + type: type=None # the return type of the callable # pragma: no mutate (OLD) | |
64 | + body=None # XXX Add the (AST of the) body LATER # pragma: no mutate (OLD) | |
65 | 65 | |
66 | 66 | |
67 | -@dataclass | |
67 | +@dataclass # pragma: no mutate | |
68 | 68 | class CC_Handler(CC_Function): # ABC Can be an event of data/stream -- with or without parameters |
69 | 69 | _ : KW_ONLY |
70 | 70 | port: CC_Port |
@@ -72,12 +72,12 @@ | ||
72 | 72 | @dataclass |
73 | 73 | class CC_EventHandler(CC_Handler): |
74 | 74 | _ : KW_ONLY |
75 | - parameterTuple: CC_TypedParameterTuple=() | |
75 | + parameterTuple: CC_TypedParameterTuple=() # pragma: no mutate (OLD) | |
76 | 76 | |
77 | 77 | @dataclass |
78 | 78 | class CC_Method(CC_Function, ABCD): |
79 | 79 | _ : KW_ONLY |
80 | - parameterTuple: CC_TypedParameterTuple=() | |
80 | + parameterTuple: CC_TypedParameterTuple=() # pragma: no mutate (OLD) | |
81 | 81 | |
82 | 82 | class CC_ClassMethod(CC_Method): pass |
83 | 83 | class CC_ElementMethod(CC_Method): pass #Or CC InstanceMethod?? |