This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

do tsukkomi for python types.

What is tsukkomi?

tsukkomi is a japanese word means straight man in the comedy duos of western culture. As straight man react partner’s ridiculous behaviors, tsukkomi will react incorrect types.

How to use tsukkomi?

tsukkomi take type hints from typing. write code with annotation, decorate all callable objects with tsukkomi.typed.typechecked. FYI generic types are not supported, see tsukkomi dosen’t support generic section for the detail.

from typing import Sequence

from tsukkomi.typed import typechecked

@typechecked
def greeting(name: str) -> str:
    return name

greeting('a') # it is ok
greeting(1) # this will raise `TypeError`

tsukkomi dosen’t support generic

tsukkomi dosen’t support generic type checking, includes types already inherited a generic type like typing.Sequence, typing.Mutable and etc. following example codes can be passed by tsukkomi.typed.typechecked.

import typing

from tsukkomi.typed import typechecked


T = typing.TypeVar('T')


class Boke(typing.Generic[T]):

    @typechecked
    def stupid(self, word: T) -> T:
        return type(word)

    @typechecked
    def correction(self, words: Sequence[T]) -> T:
        return random.sample(words, 1)[0]


@typechecked
def boke_and_tsukkomi(stupid_words: Sequence[str],
                      correction: Sequence[str]) -> bool:
    return any(s == c for s, c in zip(stupid_words, correction)))


boke = Boke[str]()
print(boke.stupid('hello world'))
print(boke.correction([1, 2, 3]))
print(boke_and_tsukkomi([1, 2], [1.0, 2.0]))

Changelogs

0.0.5 — 2016-05-19

Modified

  • Interpret None as type(None)
Release History

Release History

0.0.6

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tsukkomi-0.0.6-py3-none-any.whl (6.4 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Aug 20, 2016
tsukkomi-0.0.6.tar.gz (4.8 kB) Copy SHA256 Checksum SHA256 Source Aug 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting