diff --git a/.gitignore b/.gitignore index 248d031..02ab341 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ uv.lock .ropeproject node_modules mutants +.qwen diff --git a/README.md b/README.md index 54eca3d..d843cf6 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Python's built-in [`None`](https://docs.python.org/3/library/constants.html#None ## The problem -Programmers encounter uncertainty everywhere. We [don't know](https://en.wikipedia.org/wiki/Semipredicate_problem) in advance whether a user will enter a valid value into a form, or whether a given operation on two numbers is possible. To highlight uncertainty as a separate entity, programmers have come up with so-called [sentinel objects](https://en.wikipedia.org/wiki/Sentinel_value). These can take many forms: [NULL](https://en.wikipedia.org/wiki/Null_pointer), [`None`](https://docs.python.org/3/library/constants.html#None), [nil](https://ru.wikipedia.org/wiki/Nil), [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined), [NaN](https://en.wikipedia.org/wiki/NaN), and an infinite number of others. +Programmers encounter uncertainty everywhere. We [don't know](https://en.wikipedia.org/wiki/Semipredicate_problem) in advance whether a user will enter a valid value into a form, or whether a given operation on two numbers is possible. To highlight uncertainty as a separate entity, programmers have come up with so-called [sentinel objects](https://en.wikipedia.org/wiki/Sentinel_value). These can take many forms: [`NULL`](https://en.wikipedia.org/wiki/Null_pointer), [`None`](https://docs.python.org/3/library/constants.html#None), [`nil`](https://ru.wikipedia.org/wiki/Nil), [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined), [`NaN`](https://en.wikipedia.org/wiki/NaN), and an infinite number of others. Different programming languages and environments offer [different models](#analogs) for representing uncertainty as objects. This is usually related to how a particular language has evolved and what forms of uncertainty its users most often encounter. Broadly, I see [three](https://numberwarrior.wordpress.com/2010/07/30/is-one-two-many-a-myth/) main models: diff --git a/denial/inner.py b/denial/inner.py index 22e966f..edcda81 100644 --- a/denial/inner.py +++ b/denial/inner.py @@ -3,7 +3,7 @@ from typing import Any, Optional, Union from locklib import ContextLockProtocol -from printo import describe_data_object, not_none +from printo import describe_call, not_none from denial.errors import ( DoubleSingletonsInstantiationError, @@ -48,7 +48,7 @@ def __hash__(self) -> int: def __repr__(self) -> str: if self.id == 0 and self.auto: return 'InnerNone' - return describe_data_object(type(self).__name__, (self.id,), {'doc': self.doc, 'auto': self.auto}, filters={'auto': lambda x: x != True, 'doc': not_none}) + return describe_call(type(self).__name__, [self.id], {'doc': self.doc, 'auto': self.auto}, filters={'auto': lambda x: x != True, 'doc': not_none}) def __bool__(self) -> bool: return False diff --git a/pyproject.toml b/pyproject.toml index 63e6956..d18b48f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,21 @@ [build-system] -requires = ["setuptools==68.0.0"] -build-backend = "setuptools.build_meta" +requires = ['setuptools==68.0.0'] +build-backend = 'setuptools.build_meta' [project] -name = "denial" -version = "0.0.13" -authors = [{ name = "Evgeniy Blinov", email = "zheni-b@yandex.ru" }] +name = 'denial' +version = '0.0.14' +authors = [{ name = 'Evgeniy Blinov', email = 'zheni-b@yandex.ru' }] description = "Is one None not enough for you? There's more" -readme = "README.md" -requires-python = ">=3.8" +readme = 'README.md' +requires-python = '>=3.8' dependencies = [ - 'printo>=0.0.22', - 'locklib>=0.0.20', + 'printo>=0.0.27', + 'locklib>=0.0.21', 'typing_extensions ; python_version <= "3.10"', ] classifiers = [ - "Operating System :: OS Independent", + 'Operating System :: OS Independent', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', @@ -34,23 +34,24 @@ classifiers = [ 'License :: OSI Approved :: MIT License', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries', + 'Typing :: Typed', ] keywords = ['None', 'sentinel'] [tool.setuptools.package-data] -"denial" = ["py.typed"] +"denial" = ['py.typed'] [tool.mutmut] -paths_to_mutate = "denial" -runner = "pytest" +paths_to_mutate = 'denial' +runner = 'pytest' [tool.pytest.ini_options] -markers = ["mypy_testing"] +markers = ['mypy_testing'] [tool.ruff] lint.ignore = ['E501', 'E712', 'PTH123', 'PTH118', 'PLR2004', 'PTH107', 'SIM105', 'SIM102', 'RET503', 'PLR0912', 'C901'] -lint.select = ["ERA001", "YTT", "ASYNC", "BLE", "B", "A", "COM", "INP", "PIE", "T20", "PT", "RSE", "RET", "SIM", "SLOT", "TID252", "ARG", "PTH", "I", "C90", "N", "E", "W", "D201", "D202", "D419", "F", "PL", "PLE", "PLR", "PLW", "RUF", "TRY201", "TRY400", "TRY401"] -format.quote-style = "single" +lint.select = ['ERA001', 'YTT', 'ASYNC', 'BLE', 'B', 'A', 'COM', 'INP', 'PIE', 'T20', 'PT', 'RSE', 'RET', 'SIM', 'SLOT', 'TID252', 'ARG', 'PTH', 'I', 'C90', 'N', 'E', 'W', 'D201', 'D202', 'D419', 'F', 'PL', 'PLE', 'PLR', 'PLW', 'RUF', 'TRY201', 'TRY400', 'TRY401'] +format.quote-style = 'single' [project.urls] 'Source' = 'https://github.com/mutating/denial'