Optional typecheck

  • Thread starter Gregory Petrosyan
  • Start date
G

Gregory Petrosyan

Hello all! Please enlighten me about optional typecheck:

1) Will it be available in Python 2.5?
2) Will it support things like

def f(a: int | float)

3) Will it support interface checking like

def g(a: BookInterface)

or even mix like

def k(a: file | BookInterface)

4) Will it support things like

def t(*args: T1 | T2, **kwds: T1 | T3)
 
D

DH

Gregory said:
Hello all! Please enlighten me about optional typecheck:

1) Will it be available in Python 2.5?
2) Will it support things like

def f(a: int | float)

3) Will it support interface checking like

def g(a: BookInterface)

or even mix like

def k(a: file | BookInterface)

4) Will it support things like

def t(*args: T1 | T2, **kwds: T1 | T3)

No, not til python 3.0, which is years off.
For now you can use:
http://www.ilowe.net/software/typecheck/
Or if you want static type checking with it speed boost instead of
typechecking at runtime, there are lots of other options too.
shedskin, pyrex, scipy.weave, boo
 
G

Gregory Petrosyan

Btw, why not in 2.x?

Thanks for link, nice module. But I prefer built-in solution, that I
can use in any piece of python code. So, I'll wait for version of
Python that supports it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top