Skip to main content

f(x=None) ≡ f()

Project description

Nonelib

Remove None's from data and calls.

nonedict()

>>> from nonelib import nonedict
>>> nonedict(a=1, b=None, c=3)
{'a': 1, 'c':3}
>>> nonedict({'a': 1, 'b': None, 'c':3})
{'a': 1, 'c':3}

@nonewrap

>>> from nonelib import nonewrap
>>> @nonewrap
>>> def s(lst, offset=3, limit=3):
...     return lst[offset:offset+limit]
>>> s([1,2,3,4,5,6,7,8,9,10], offset=None, limit=5)  # offset=3 is in effect
[4, 5, 6, 7, 8]

nonelist()

>>> from nonelib import nonelist
>>> nonelist([1, None, 3])
[1, 3]

noneset()

>>> from nonelib import noneset
>>> noneset({1, None, 3})
{1, 3}

noneiter()

>>> from nonelib import noneiter
>>> for x in noneiter([1, None, 3]):
...     print(x)
1
3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonelib-0.0.1.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

nonelib-0.0.1-py3-none-any.whl (1.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page