Module import vs using

I’m confused by this table in the docs. The last column is identical for rows 1,3 (import MyModule and using MyModule), which seems inconsistent with the previous paragraph:

import also differs from using in that functions imported using import can be extended with new methods.

The last statement means that functions imported via import are available for extension without the additional module qualifier, i.e. it refers to the last column of rows 2, 4 and 5.

Thanks @Vasily_Pisarev, I’m just wondering why is column 3 the same for rows 1 and 3, sorry if that wasnt clear

This was also recently discussed:

2 Likes

Aha, so what I was trying to say was

all functions from a given module are always available for method extension in their module’s scope . So, if the module Foo has been brought into scope of module Bar (with using or import ), its functions can be extended in the code of Bar referring to them as Foo.x , etc.

While the cited paragraph from the docs refers to another case, corresponding to table’s rows 2, 4 and 5.

Yes, the nuance is that the paragraph of the docs says:

functions imported using import

And this happens only in rows 4 and 5 (to be compared with row 2, where you are using functions). In rows 1 and 3 you are not importing/using functions, but the module that contains them.