Browse thread
type inference for python
- Philippe Fremy
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Philippe Fremy <pfremy@i...> |
| Subject: | type inference for python |
Hi,
I would like to implement something similar to the type inference of
ocaml for the python language. I have always found it very impressive
(although I have only used caml light).
I have no experience with the topic, it is just a project that seems
cool to me :-)
Do you have any hints or where I could build up my knowledge (code,
books, article, ...) to do that kind of thing.
I imagine that it works in a kind of three way pass:
1. analyse all the constraints of the code
Ex:
def f(a): a.append(1)
def g(a): a=a+1; f(a)
g('coucou')
=> a must support append
=> a must also be an int
2. cross-validate the constraints consistency
=> inconsistent assertions
3. validate the constraints against reality
=> g('coucou') will not work
The 2. and 3. looks like the most difficult aspect of it.
regards,
Philippe
--
Philippe Fremy
InSeal Technical Director
tel: +33 6 07 98 76 44