devel/py-undefined: Add py-undefined 0.0.8

Ever needed a global object that act as None but not quite? Like for example
keyword argument for function, where None make sense, so you need a default
value.

One solution is to create as singleton object:
mysingleton = object()

Though it becomes difficult to track the singleton across libraries, and teach
users where to import this from. It's also relatively annoying use this
singleton across library.

Introducing undefined:
>>> import undefined
>>> from undefined import Undefined
>>> undefined is Undefined
True
This commit is contained in:
Po-Chuan Hsieh 2024-03-31 11:05:07 +08:00
parent 9815657e79
commit 6c7bd70255
No known key found for this signature in database
GPG key ID: 9A4BD10F002DD04B
5 changed files with 52 additions and 0 deletions

View file

@ -5825,6 +5825,7 @@
SUBDIR += py-ubelt
SUBDIR += py-uhid-freebsd
SUBDIR += py-ujson
SUBDIR += py-undefined
SUBDIR += py-unearth
SUBDIR += py-unicodecsv
SUBDIR += py-unicodedata2

View file

@ -0,0 +1,21 @@
PORTNAME= undefined
PORTVERSION= 0.0.8
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Simple package
WWW= https://github.com/Carreau/undefined
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flit-core>=0:devel/py-flit-core@${PY_FLAVOR}
USES= python
USE_PYTHON= autoplist concurrent pep517
NO_ARCH= yes
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1710609060
SHA256 (undefined-0.0.8.tar.gz) = c6f237c0e3d7e7519694b21bd471dc25ee3c3379d9c23b74ebf02aa349c5cff7
SIZE (undefined-0.0.8.tar.gz) = 3137

View file

@ -0,0 +1,11 @@
--- pyproject.toml.orig 2019-07-26 01:33:34 UTC
+++ pyproject.toml
@@ -1,6 +1,6 @@
[build-system]
-requires = ["flit"]
-build-backend = "flit.buildapi"
+requires = ["flit_core"]
+build-backend = "flit_core.buildapi"
[tool.flit.metadata]
module = "undefined"

View file

@ -0,0 +1,16 @@
Ever needed a global object that act as None but not quite? Like for example
keyword argument for function, where None make sense, so you need a default
value.
One solution is to create as singleton object:
mysingleton = object()
Though it becomes difficult to track the singleton across libraries, and teach
users where to import this from. It's also relatively annoying use this
singleton across library.
Introducing undefined:
>>> import undefined
>>> from undefined import Undefined
>>> undefined is Undefined
True