Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BenitzCoding committed Apr 18, 2022
2 parents 941cbff + feb3de2 commit f9a1bb4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Examples
**GlobalJSON:**

.. code:: python
import cool_utils
cool_utils.GlobalJSON.open("sample")
Expand All @@ -100,7 +101,7 @@ This wouldn’t be made possible without these people

1. `BenitzCoding <https://github.com/BenitzCoding>`__
2. `JDJG Inc. Official <https://github.com/JDJGInc>`__
3. `P3ter <https://github.com/darkp3ter>`__
3. `P3ter`
4. `Proguy <https://github.com/proguy914629bot>`__

.. |Discord| image:: https://discord.com/api/guilds/886543799843688498/embed.png
Expand Down
2 changes: 1 addition & 1 deletion cool_utils/_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __hash__(self):
return 0

def __repr__(self):
return '<Missing>'
return '...'


MISSING: Any = _Missing()
6 changes: 3 additions & 3 deletions cool_utils/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def store(variable: str, value: Any) -> None:
raise ValueError("Cannot store _size")

payload = {
"_size": (1 + _cache["size"]),
"_size": (1 + _cache["_size"]),
f"{variable}": value
}
_cache.update(payload)
Expand Down Expand Up @@ -117,14 +117,14 @@ def remove(variable: Any) -> Any:

class Cache:
def __init__(self):
self._cache = None
self._cache = {"_size": 0}

def store(self, variable: str, value: Any) -> None:
if variable == "_size":
raise ValueError("Cannot store _size")

payload = {
"_size": (1 + self._cache["size"]),
"_size": (1 + self._cache["_size"]),
f"{variable}": value
}
self._cache.update(payload)
Expand Down

0 comments on commit f9a1bb4

Please sign in to comment.