Skip to content

unitedsoftwork/python-not-none

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-not-none

Simple decorator for preventing null arguments from being passed as a parameter.

Usage

from not_none import not_none

@not_none()
def no_none(a,b):
    return (a,b)
    
@not_none(nullable_parameters=["b"])
def allow_b_as_none(a,b):
    return (a,b)

#passes
no_none(1,1)

#fails
no_none(None,1)

#passes
allow_b_as_none(1,None)

#fails
allow_b_as_none(None,1)

  

Notes:

Using this decorator requires "()"

e.g.

@not_none()

not

@not_none

About

Decorator for preventing None arguments from being passed as a parameter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages