Skip to main content

undefined: simulates the JavaScript undefined behaviour in Python

Project description

undefined by Ouroboros Coding

pypi version MIT License

undefined: A value to use as a default value to indicate an argument was absolutely not set buy the user of the method. Will not match as true to any other value but itself.

Installation

pip install undefined-oc

Import

import undefined

def print_me(value = undefined):
  if value is undefined:
    print('Please pass a value to print')
  else:
    print(value)
>>> print_me('hello, there')
hello, there
>>> print_me(None)
None
>>> print_me([])
[]
>>> print_me()
Please pass a value to print

Supported by

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