GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JustusAdam/python-typesafety: A decorator for python functions that does type checking.

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
src/typesafe
src/typesafe
 
 
.gitignore
.gitignore
 
 
GPLv2
GPLv2
 
 
LICENSE
LICENSE
 
 
MANIFEST
MANIFEST
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 

Repository files navigation

Python typesafety Package status

Python typesafety provides a decorator for python functions which uses the normally optional type annotations and perform typechecking based on these annotations both on the function arguments (before function execution) and the return value (after function execution).

Non annotated values will be left untouched.

Since annotations were only added in Python 3 this decorator will not work for previous versions of python. Very unfortunate, annotations are awesome. :)

Usage

import typesafe

@typesafe
def my_func(this_gets_checked:int, this_doesnt) -> str:
    pass

Overhead

Despite my best attempts at making this decorator as fast and efficient as possible it still introduces a substantial amount of overhead into your program.

However it is designed such that if the python interpreter has been invoked in optimized mode (-O option or PYTHONOPTIMIZE environment variable) the decorator will just return the function itself, posing zero runtime overhead.

About

A decorator for python functions that does type checking.

Resources

Readme
License
Activity

Stars

2 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.