This repository was archived by the owner on Apr 20, 2025. It is now read-only.
Commit 3b31182
Remove overlapping slots from AbstractKey subclasses
`PublicKey` and `PrivateKey` both define the `n` and `e` slots, which
are already present in their base class. This reduces the benefits of
having slots.
```shell
$ slotscheck -m rsa -v
ERROR: 'rsa.key:PrivateKey' defines overlapping slots.
- e (rsa.key:AbstractKey)
- n (rsa.key:AbstractKey)
ERROR: 'rsa.key:PublicKey' defines overlapping slots.
- e (rsa.key:AbstractKey)
- n (rsa.key:AbstractKey)
```
The Python docs say:
> If a class defines a slot also defined in a base class, the instance
> variable defined by the base class slot is inaccessible (except by
> retrieving its descriptor directly from the base class). This renders
> the meaning of the program undefined.1 parent 6391b1a commit 3b31182
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| |||
0 commit comments