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.5.tar.gz (2.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: try_except-0.0.5.tar.gz
  • Upload date:
  • Size: 2.2 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.5.tar.gz
Algorithm Hash digest
SHA256 85e4b56dfe300c65e58af63257f96ec89fa09c4b3e2adf7d462af16b0417edf2
MD5 d8076d8d1586c82e73885e91648845f7
BLAKE2b-256 3dd69c4e7f40ea1ebf7716cc0ffaa0bc5f6319bfb451daeb9d0ecf467429e572

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