PyWart: Module access syntax

Nicholas Cole nicholas.cole at gmail.com
Sat Jan 12 07:16:20 EST 2013


On Fri, Jan 11, 2013 at 6:01 AM, Rick Johnson
<rantingrickjohnson at gmail.com>wrote:

>
> Python's module/package access uses dot notation.
>
>   mod1.mod2.mod3.modN
>
> Like many warts of the language, this wart is not so apparent when first
> learning the language. The dot seems innocently sufficient, however, in
> truth it is woefully inadequate! Observe:
>
>  name1.name2.name3.name4.name5
>
>
I find it reassuring to have these kinds of questions on the list, because
they actually remind me how brilliantly designed Python is.

As the user of a module I shouldn't care about the internal arrangement of
objects and files.  I don't care.  More than that, as the writer of a
module I should be free to refactor the internals of a module without
breaking existing code.

There is absolutely nothing wrong at all with the syntax. In fact, it's
fantastic.

N.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130112/566d25dc/attachment.html>


More information about the Python-list mailing list