Commit 012b86d
authored
[SofaPython3] Add an hasObject method in Binding_Node to detect if a node has an object. (#154)
With the current binding it is possible to detect if a node has an object using
the default python hasattr() function. But because of how hasattr() is implement
it imply the generation of the bindinged object regardeless this is usefull or not
from the callee's point of view.
So we add a fast path version, with the corresponding documentation and tests.1 parent 8d83a97 commit 012b86d
File tree
3 files changed
+34
-2
lines changed- bindings/Sofa
- src/SofaPython3/Sofa/Core
- tests/Simulation
3 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
477 | 485 | | |
478 | 486 | | |
479 | 487 | | |
| 488 | + | |
480 | 489 | | |
481 | 490 | | |
482 | 491 | | |
| |||
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | 149 | | |
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
| |||
188 | 198 | | |
189 | 199 | | |
190 | 200 | | |
191 | | - | |
| 201 | + | |
192 | 202 | | |
193 | 203 | | |
194 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
177 | 190 | | |
178 | 191 | | |
179 | 192 | | |
| |||
0 commit comments