typeid-python 0.2.2__tar.gz → 0.2.3__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.

Potentially problematic release.


This version of typeid-python might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: typeid-python
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs
5
5
  Home-page: https://github.com/akhundMurad/typeid-python
6
6
  License: MIT
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.8
16
16
  Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
19
20
  Provides-Extra: cli
20
21
  Requires-Dist: uuid6 (>=2023.5.2,<2024.0.0)
21
22
  Project-URL: Repository, https://github.com/akhundMurad/typeid-python
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "typeid-python"
3
- version = "0.2.2"
3
+ version = "0.2.3"
4
4
  description = "Python implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs"
5
5
  authors = ["Murad Akhundov <akhundov1murad@gmail.com>"]
6
6
  license = "MIT"
@@ -13,6 +13,7 @@ classifiers = [
13
13
  "Programming Language :: Python :: 3.9",
14
14
  "Programming Language :: Python :: 3.10",
15
15
  "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
16
17
  "Operating System :: OS Independent",
17
18
  ]
18
19
  keywords = ["typeid", "uuid", "uuid6", "guid"]
@@ -1,3 +1,4 @@
1
+ import warnings
1
2
  from typing import Optional
2
3
  from uuid import UUID
3
4
 
@@ -47,22 +48,35 @@ class TypeID:
47
48
  value += self.suffix
48
49
  return value
49
50
 
51
+ def __repr__(self):
52
+ return "%s(%r)" % (self.__class__.__name__, str(self))
53
+
50
54
  def __eq__(self, value: object) -> bool:
51
55
  if not isinstance(value, TypeID):
52
56
  return False
53
57
  return value.prefix == self.prefix and value.suffix == self.suffix
54
58
 
59
+ def __gt__(self, other):
60
+ if isinstance(other, TypeID):
61
+ return str(self) > str(other)
62
+ return NotImplemented
63
+
64
+ def __ge__(self, other):
65
+ if isinstance(other, TypeID):
66
+ return str(self) >= str(other)
67
+ return NotImplemented
68
+
55
69
  def __hash__(self) -> int:
56
70
  return hash((self.prefix, self.suffix))
57
71
 
58
72
 
59
73
  def from_string(string: str) -> TypeID:
60
- """Consider TypeID.from_string instead."""
74
+ warnings.warn("Consider TypeID.from_string instead.", DeprecationWarning)
61
75
  return TypeID.from_string(string=string)
62
76
 
63
77
 
64
78
  def from_uuid(suffix: UUID, prefix: Optional[str] = None) -> TypeID:
65
- """Consider TypeID.from_uuid instead."""
79
+ warnings.warn("Consider TypeID.from_uuid instead.", DeprecationWarning)
66
80
  return TypeID.from_uuid(suffix=suffix, prefix=prefix)
67
81
 
68
82
 
File without changes
File without changes