On Wed, Jun 5, 2013 at 2:19 AM, Rick Johnson <rantingrickjohn...@gmail.com> wrote: > On Jun 4, 11:00 am, Chris Angelico <ros...@gmail.com> wrote: >> You know, if you want a language with strict type declarations and >> extreme run-time efficiency, there are some around. > > I don't like declaring types everywhere, i hate it. I prefer duck > typed languages, HOWEVER, in order for duck typing to work > consistently you must have checks and balances that the programmer can > apply when he feels necessary. My "is_valid" built in will bridge the > gap. We won't be forced to declare types, but we should ALWAYS add > "type checks" to our "truth tests" unless we want to create subtle > bugs. "is_valid" IS the answer!
Option 1: void C_function(int x) Option 2: def Python_function(x): assert isinstance(x,int) Is there a fundamental difference? You're basically proposing Option 2 while detesting Option 1. ChrisA -- http://mail.python.org/mailman/listinfo/python-list