Skip to main content

Cheating Try Except

Project description

About


def try_except(t: func, ex: Exception = None):
  try:
    result = t()
    return result
  except Exception as e:
    if isinstance(e,ex):
      return e
    elif ex is None:
      return None
    else:
      return False

^^^ This is literally all the code

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

try_except-0.0.7.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file try_except-0.0.7.tar.gz.

File metadata

  • Download URL: try_except-0.0.7.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.5

File hashes

Hashes for try_except-0.0.7.tar.gz
Algorithm Hash digest
SHA256 d949dbd9556c30118fdd4cfa20f86f38038c605892041b7763f10184abe02334
MD5 532a9e15fad46cf842974a8e98249b4b
BLAKE2b-256 39212bcbb3768aae07ca1bcea9e6b259c04112322262371cd753e202f2360074

See more details on using hashes here.

Supported by

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