Applications Google
Menu principal

Post a Comment On: Only Python

"Python as pseudo-code and Optional Static Typing"

5 Comments -

1 – 5 of 5
Anonymous Anonymous said...

For this to work reliably, the dynamic nature of Python should be reduced a bit. Like, what does `abs' refer to? The built-in function? Or perhaps a user-defined function with the same name?

What if `int' is subclassed, and the `__mod__' or `__lt__' method overridden?

7:39 AM

Anonymous Anonymous said...

>What if `int' is subclassed, and the `__mod__' or >`__lt__' method overridden?

When a programmer overides a method, it is to get a specific comportment, and you (library programmer) got to trust he knows what he does.
Overriding definitions doesn't mean your code is not coherent anymore, it just means it acquires another signification. And Euclide PGCD algorithm keeps beeing Euclide PGCD algorithm.

8:58 AM

Anonymous Anonymous said...

So, really, "var: expr" is a short-hand for "assert istypeof(var, expr)".

--Chris Ryland, cpr@emsoftware.com

9:46 AM

Blogger André Roberge said...

Chris Ryland wrote:

So, really, "var: expr" is a short-hand for "assert istypeof(var, expr)".
===
Essentially; I'm not aware of the function istypeof(), but I would say that "var: expr" is a short hand for
"assert isinstanceof(var, expr)"
which I read to be the same thing.
Note that "var: expr" is also the notation proposed by Guido van Rossum in his blog.

11:31 AM

Comment deleted

This comment has been removed by a blog administrator.

1:27 AM

Spammers: none shall pass.
You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot