Re: PEP 451: Big update.
Eric Snow <[email protected]> Thu, 19 Sep 2013 13:42:57 -0600
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CALFfu7C_nWYDYK+sT4d9sh-LQRseBzVHXPcgR4JyVQBBUc9svg@mail.gmail.com> |
On Thu, Sep 19, 2013 at 8:30 AM, Nick Coghlan <[email protected]> wrote: > On 20 Sep 2013 00:12, "Brett Cannon" <[email protected]> wrote: > > On Thu, Sep 19, 2013 at 6:22 AM, Antoine Pitrou <[email protected]> > 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 _______________________________________________ Import-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/import-sig