scaevola 1.0.14__tar.gz → 1.0.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scaevola
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: This project provides a class with preset right handed magic methods.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -24,7 +24,7 @@ keywords = []
24
24
  name = "scaevola"
25
25
  readme = "README.rst"
26
26
  requires-python = ">=3.11"
27
- version = "1.0.14"
27
+ version = "1.0.16"
28
28
 
29
29
  [project.license]
30
30
  file = "LICENSE.txt"
@@ -4,6 +4,9 @@ __all__ = ["Scaevola"]
4
4
 
5
5
 
6
6
  class Scaevola:
7
+
8
+ __slots__ = ()
9
+
7
10
  def __ge__(self: Self, other: Any) -> Any:
8
11
  "This magic method implements self>=other."
9
12
  return type(self)(other) <= self
@@ -0,0 +1,34 @@
1
+ import unittest
2
+ from typing import *
3
+
4
+ from scaevola.core import Scaevola
5
+
6
+
7
+ class Foo(Scaevola):
8
+ __slots__ = ("x", "y")
9
+
10
+
11
+ class Bar(Scaevola):
12
+ pass
13
+
14
+
15
+ class TestSlots(unittest.TestCase):
16
+ def test_foo(self: Self) -> None:
17
+ foo: Foo = Foo()
18
+ foo.x = 4
19
+ foo.y = 2
20
+ self.assertEqual(foo.x, 4)
21
+ self.assertEqual(foo.y, 2)
22
+ with self.assertRaises(AttributeError):
23
+ foo.z = 0
24
+
25
+ def test_bar(self: Self) -> None:
26
+ bar: Bar = Bar()
27
+ bar.x = 4
28
+ bar.y = 2
29
+ self.assertEqual(bar.x, 4)
30
+ self.assertEqual(bar.y, 2)
31
+
32
+
33
+ if __name__ == "__main__":
34
+ unittest.main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scaevola
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: This project provides a class with preset right handed magic methods.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -11,4 +11,5 @@ src/scaevola.egg-info/dependency_links.txt
11
11
  src/scaevola.egg-info/top_level.txt
12
12
  src/scaevola/tests/__init__.py
13
13
  src/scaevola/tests/test_0.py
14
- src/scaevola/tests/test_op.py
14
+ src/scaevola/tests/test_op.py
15
+ src/scaevola/tests/test_slots.py
File without changes
File without changes
File without changes
File without changes