typesafe

Formal type checking decorators
Download

typesafe Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Price:
  • FREE
  • Publisher Name:
  • Krister Hedfors
  • Publisher web site:
  • http://hedfors.se

typesafe Tags


typesafe Description

Formal type checking decorators The typesafe package offers formal type checking decorators.Usage: from typesafe import * @hard_types( name=str, age=(int,float)) def func_or_method(name, age): pass @hard_types(dict( name=str, age=(int,float) )) def func_or_method(name, age): pass The @hard_types() decorator raises HardTypesException unless arguments are of the specified type or types: @hard_types(argname=type, ) @hard_types(argname=types, ) The @soft_types() decorator raises SoftTypesException unless argument types match, or are subtypes, of the specified type or types. @soft_types(argname=type, ) @soft_types(argname=types, ) Requirements: · Python


typesafe Related Software