what does := means simply?
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Thu May 17 21:45:26 EDT 2018
On Fri, 18 May 2018 02:17:39 +0100, bartc wrote:
> Normally you'd use the source code as a start point. In the case of
> Python, that means Python source code. But you will quickly run into
> problems because you will often see 'import lib' and be unable to find
> lib.py anywhere.
Seriously? There's a finite number of file extensions to look for:
.py .pyc .pyo .pyw .dll .so
pretty much is the lot, except on some obscure platforms which few people
use.
To successful port anything but the most trivial code, you actually have
to understand *both* languages -- including the syntax, semantics, built-
in language features, AND libraries.
> That's one problem. Others might involve how to deal with something like
> __globals__ which doesn't have an equivalent in the target language. And
> we haven't started on features that are specific to Python.
How about features which are specific to C, or Scheme, or Forth, or APL,
or bash, or Fortran, or Intercal, or Java, or Javascript, or Ruby, or
Smalltalk, or Rust, or Go, or any of hundreds of other languages?
Since every language has features that some other languages don't have,
is it your position that it is impossible to port code from any language
to any other?
If you want to *really* see code that is hard to port, you should try
porting an Inform 7 program to another language. Any other language.
--
Steve
More information about the Python-list
mailing list