Skip to content

Commit

Permalink
Use __slots__ to optimize memory usage (#10)
Browse files Browse the repository at this point in the history
* Use `__slots__` to optimize memory usage

* Version bump
  • Loading branch information
raymondjavaxx authored Mar 9, 2024
1 parent 1125155 commit 237b881
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## v0.3.1

### Changed

- Use `__slots__` to optimize memory usage.

## v0.3.0

### Added
Expand Down
2 changes: 2 additions & 0 deletions mp_yearmonth/yearmonth.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class YearMonth:
month (int) : The month.
"""

__slots__ = ("year", "month")

def __init__(self, year: int, month: int):
"""Create a new YearMonth object.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mp-yearmonth"
version = "0.3.0"
version = "0.3.1"
description = "A year-month datatype for Python."
keywords = ["year", "month", "date", "calendar"]
authors = ["Ramon Torres <[email protected]>"]
Expand Down

0 comments on commit 237b881

Please sign in to comment.