Thanks to visit codestin.com
Credit goes to github.com

Skip to content

llmonpy/nothingpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nothingpy

Nothing is a replacement for None that eliminates the need for many if statements. I am tired of writing code like this:

if some_list:
    for item in some_list:
        do_something(item)

If you use Nothing instead of None, you can write code like this:

for item in some_list:
    do_something(item)

Nothing is a global variable of the class NothingClass. Nothing has a len of 0, is False, returns an empty iterable, converts to an empty string, and responds to values(), keys() and items() like an empty dictionary. Nothing equals other NothingClass instances, None and False.

Installation

pip install nothingpy

Usage

from nothingpy import Nothing

some_variable = Nothing

About

Nothing is a replacement for None that eliminates the need for many if statements

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages