On 04/07/2016 15:46, Ned Batchelder wrote:
On Monday, July 4, 2016 at 10:36:54 AM UTC-4, BartC wrote:
On 04/07/2016 13:47, Ned Batchelder wrote:

This is a huge change.

I've used a kind of 'weak' import scheme elsewhere, corresponding to C's
'#include'.

I think that could work in Python provided whatever is defined can
tolerate having copies redefined in each module that includes the same
file. Anything that is defined once and is never assigned to nor
modified for example.

You are hand-waving over huge details of semantics that are very important
in Python.  For example, it is very important not to have copies of
classes.  Importing a module must produce the same module object
everywhere it is imported, and the classes defined in the module must
be defined only once.

So that would be something that doesn't tolerate copies.

But I think that a bigger change for Python wouldn't be new ways of doing imports, but the concept of having a user-defined anything that is a constant at compile-time. And not part of a conditional statement either.

Usually anything that is defined can be changed at run-time so that the compiler can never assume anything.

--
Bartc

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to