473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Optional typecheck

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)

Jan 7 '06 #1
2 1460
DH
Gregory Petrosyan wrote:
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
Jan 7 '06 #2
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.

Jan 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kirk McDonald | last post by:
I'm examining the C API, and I have a question. http://docs.python.org/api/object.html There are two functions that appear to do nearly same thing, and I just want to be certain I'm not...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
6
by: Christian Convey | last post by:
Hi guys, I'm looking at developing a somewhat complex system, and I think some static typing will help me keep limit my confusion. I.e.: ...
1
by: Tookelso | last post by:
Hello, I would like to have a group of elements which are *required* in one context, but each one is *optional* in another context. For example: I have a configuration file which has a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.