File: test_simple.py

package info (click to toggle)
python-multipledispatch 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 272 kB
  • sloc: python: 1,116; makefile: 141
file content (17 lines) | stat: -rw-r--r-- 239 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from multipledispatch import dispatch


@dispatch(int)
def isint(x):
    return True


@dispatch(object)
def isint(x):
    return False


def test_simple():
    for _ in range(100000):
        assert isint(5)
        assert not isint("a")