Repository navigation
Commit 9325cca
ref(compat): Remove unused with_metaclass helper (#8153)
### Description
Removes `with_metaclass()` from `sentry_sdk/_compat.py`. Nothing on
`major/3.0` uses it anymore.
It's a Python 2 / `six`-style helper for declaring a metaclass across
Python versions; on Python 3 you just write `class Foo(metaclass=Meta)`.
Its only caller was `class Hub(with_metaclass(HubMeta))` in
`sentry_sdk/hub.py`. #6919 ("Drop hub related code in new major")
deleted `Hub` and the import, but left the helper behind.
With the helper gone, the `TYPE_CHECKING` block in `_compat.py` (`Any`,
`TypeVar`, `T`) is unused too, so it's removed as well. `T` wasn't used
before this change either.
**Evidence**
- On `major/3.0`, `git grep with_metaclass` matches only the definition.
There are no callers in `sentry_sdk`, `tests`, `scripts` or `docs`.
- Nothing imports `T` or `Any` from `sentry_sdk._compat`.
- #6091 and #7421 (against `master`) proposed the same removal as part
of larger Python 2 cleanups. Both were closed without being merged, one
for inactivity. Neither raised an objection to this change. On `master`,
`Hub` still uses the helper, so this only applies to `major/3.0`.
`_compat` is a private module, so this doesn't touch the public API.
#### Issues
n/a
<!-- junior-request-attribution:start -->
via **Ivana Kellyer**.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 -->
--
[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?project=4510944073809921)
<!-- junior-session-footer:end -->
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>1 parent 20df0da commit 9325cca
1 file changed
Lines changed: 0 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 2 | | |
10 | 3 | | |
11 | 4 | | |
12 | 5 | | |
13 | 6 | | |
14 | 7 | | |
15 | 8 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 9 | | |
25 | 10 | | |
26 | 11 | | |
| |||
0 commit comments