Commit be1963c
committed
refactor: Be more consistent regarding not overriding submodules with aliases
Our documentation states that a submodule will always get precedence over an alias of the same name. But the code only avoided replacing a submodule when the alias was pointing to the module.
With this change, we avoid replacing the submodule with *any* alias of the same name, not just aliases that point to the submodule.
The reason we do this is that Griffe suffers from a limitation where a module cannot store both a submodule and anoter member of the same name. We previously decided not to lift this limitation, because we consider this kind of name-shadowing bad practice. We document it in our "Recommendations / Python code" page.1 parent fbad6f5 commit be1963c
2 files changed
+24
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
401 | | - | |
| 400 | + | |
| 401 | + | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
| 409 | + | |
413 | 410 | | |
414 | 411 | | |
415 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
0 commit comments