[Import-SIG] PEP 451: Big update.

Eric Snow ericsnowcurrently at gmail.com
Thu Sep 19 21:42:57 CEST 2013


On Thu, Sep 19, 2013 at 8:30 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:

> On 20 Sep 2013 00:12, "Brett Cannon" <brett at python.org> wrote:
> > On Thu, Sep 19, 2013 at 6:22 AM, Antoine Pitrou <solipsis at pitrou.net>
> wrote:
> >> > has_location (RO-property) - the module's origin refers to a location.
> >>
> >> filesystem location? What about ZIP files?
> >
> >
> > It's a flag to basically say that origin contains what __file__ should
> be.
>
> Thus indicating that get_data() on the loader can be used sensibly.
> Perhaps we could just make setting __file__ conditional on the loader
> defining get_data, rather than having it be a spec attribute?
>
I'd still like to keep an explicit "has_location" as a clear, informational
declaration.  How about we always set it to True if loader.get_data exists?
 I think you proposed this before and it got lost in the shuffle.

> I also suggest that we adopt the convention of using angle brackets in
> non-location origins. So names like "<builtin>" and "<frozen>".
>
Well, I'm already having module_repr() do that.  I've thought of this
before, but decided it was better to have the separate "has_location"
attribute.  Then there is no ambiguity between the origin of a
non-locatable module and a locatable one that happens to have bookend angle
brackets.  I will make sure the spec is explicit about the angle brackets
in module_repr().

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20130919/d25f0270/attachment.html>


More information about the Import-SIG mailing list