Matlab vs Python (was RE: Discussion: Introducing new operators for matrix computation)

Gordon McMillan gmcm at hypernet.com
Mon Jul 17 23:01:25 EDT 2000


Huaiyu Zhu wrote: 

>I don't see such arguments as any different from the claim that string
>literals are sintactic sugar for the single domain of text processing
>only (web and re and so on being subdomains).  Since by such definition
>text processing is a very large domain I do want string literals even
>just for this only domain, even if it does not include everything.

Look at it this way: the implementation of Python is based on strings, 
tuples, dicts and lists. So they came for free. The most exotic operators 
Python currently has are probably the shift operators. That's really not a 
good precedent for 8 new operators.

[bjorn suggest preprocessing...]

>This could work if there is a hook so that 
>
>import mymodule
>
>would automatically run
>
>preprocessor < mymodule.mpy > mymodule.py
>
>anywhere in the path.  It should do this after examining the timestamp
>just like current import does.  Otherwise after a few surprises people
>would keep .py instead of .mpy so it is just a helper for writing, but
>not useful for extending or maintaining code,

Get Greg Stein's imputil.py from 
 http://www.lyra.org/greg/python/
(or wait for BeOpen's first release - it'll be in the std lib). It has a 
hook for this.

-Gordon




More information about the Python-list mailing list