tag:blogger.com,1999:blog-9266717.post110530771842653502..comments2023-05-22T10:01:23.167-03:00Comments on Only Python: Python as pseudo-code and Optional Static TypingAndré Robergehttp://www.blogger.com/profile/08131391818998844540noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-9266717.post-1107926842662361932005-02-09T01:27:00.000-04:002005-02-09T01:27:00.000-04:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9266717.post-1105457513582244062005-01-11T11:31:00.000-04:002005-01-11T11:31:00.000-04:00Chris Ryland wrote:
So, really, "var: expr" is...Chris Ryland wrote:<br /><br /> So, really, "var: expr" is a short-hand for "assert istypeof(var, expr)".<br />===<br />Essentially; I'm not aware of the function istypeof(), but I would say that "var: expr" is a short hand for<br />"assert isinstanceof(var, expr)"<br />which I read to be the same thing.<br />Note that "var: expr" is also the notation proposed by Guido van Rossum in his blog.André Robergehttps://www.blogger.com/profile/08131391818998844540noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-1105451168616817472005-01-11T09:46:00.000-04:002005-01-11T09:46:00.000-04:00So, really, "var: expr" is a short-hand for "asser...So, really, "var: expr" is a short-hand for "assert istypeof(var, expr)".<br /><br />--Chris Ryland, cpr@emsoftware.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9266717.post-1105448305118076692005-01-11T08:58:00.000-04:002005-01-11T08:58:00.000-04:00>What if `int' is subclassed, and the `__mod__' or...>What if `int' is subclassed, and the `__mod__' or >`__lt__' method overridden?<br /><br />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.<br />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.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9266717.post-1105443542240463712005-01-11T07:39:00.000-04:002005-01-11T07:39:00.000-04:00For this to work reliably, the dynamic nature of P...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?<br /><br />What if `int' is subclassed, and the `__mod__' or `__lt__' method overridden?Anonymousnoreply@blogger.com