Repository navigation
Commit c29e3f3
fix: deprecate adjacent()/vertices() properly instead of hard-breaking
UVertex.adjacent() had been removed outright with no migration path --
renamed to neighbours()/neighbors() with zero deprecation phase, so any
caller still using the old name got a bare AttributeError. Restored it
as a thin wrapper: still calls neighbours() and returns its result, but
now emits a DeprecationWarning first, giving callers a working upgrade
path instead of an immediate break.
Also fixed the same underlying anti-pattern already present nearby in
Edge.vertices(): it did `raise DeprecationWarning(...)`, which aborts
the call exactly like a missing method would (DeprecationWarning is
just an Exception subclass when raised directly) -- no backward
compatibility at all, and it never goes through the actual warnings
machinery (no -W flag control, no filterwarnings support). Now uses
warnings.warn(..., DeprecationWarning, stacklevel=2) and still returns
self.endpoints, matching the same real deprecation pattern as
adjacent() above.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 13582c4 commit c29e3f3
2 files changed
Lines changed: 57 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
1582 | 1583 | | |
1583 | 1584 | | |
1584 | 1585 | | |
1585 | | - | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1586 | 1600 | | |
1587 | 1601 | | |
1588 | 1602 | | |
| |||
1673 | 1687 | | |
1674 | 1688 | | |
1675 | 1689 | | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
1676 | 1706 | | |
1677 | 1707 | | |
1678 | 1708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
282 | 294 | | |
283 | 295 | | |
284 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
285 | 311 | | |
286 | 312 | | |
287 | 313 | | |
| |||
0 commit comments