datedict 0.1.4__tar.gz → 0.1.6__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 datedict might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datedict
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: DateDict and YearDict: date-aware dictionary structures
5
5
  Project-URL: Homepage, https://gitlab.com/grisus/datedict
6
6
  Project-URL: Issues, https://gitlab.com/grisus/datedict/-/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "datedict"
7
- version = "0.1.4"
7
+ version = "0.1.6"
8
8
  description = "DateDict and YearDict: date-aware dictionary structures"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -7,9 +7,10 @@ from .common import NAN, ONE, Decimable, to_decimal, ZERO
7
7
 
8
8
  class DateDict:
9
9
  def __init__(self, data: Mapping[str, Decimable] = dict(), strict: bool = True):
10
- if not data:
11
- raise ValueError("Data cannot be empty.")
12
10
  dates = sorted(data.keys())
11
+ if len(dates) == 0:
12
+ self.data = {}
13
+ return
13
14
  if strict:
14
15
  # enforce contiguous coverage
15
16
  if dates != [
@@ -6,9 +6,10 @@ from .common import NAN, ONE, Decimable, to_decimal, ZERO
6
6
 
7
7
  class YearDict:
8
8
  def __init__(self, data: Mapping[int, Decimable] = dict(), strict: bool = True):
9
- if not data:
10
- raise ValueError("Data cannot be empty.")
11
9
  years = sorted(data.keys())
10
+ if len(years) == 0:
11
+ self.data = {}
12
+ return
12
13
  if strict:
13
14
  # enforce contiguous coverage
14
15
  if years != list(range(years[0], years[-1] + 1)):
File without changes
File without changes
File without changes
File without changes
File without changes