Re: PEP 451: Big update.
Eric Snow <[email protected]> Thu, 19 Sep 2013 10:42:01 -0600
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <CALFfu7A8bqVNaOP5L=Ue+JmXd+J6UTGb0tzM8HkvvCdxQrSGMw@mail.gmail.com> |
On Thu, Sep 19, 2013 at 2:17 AM, Nick Coghlan <[email protected]> wrote: > On 19 September 2013 15:38, Eric Snow <[email protected]> wrote: > > I'm thinking that it may be useful to have ModuleSpec inherit from str > and > > set it to the module name. Then the spec could be passed directly to > those > > loader APIs that take the module name. Thoughts? > > I think I'd need to see the code you think it would simplify before > saying yes (since my default answer is "No, inheriting from str is an > unnecessary hack"). > On Thu, Sep 19, 2013 at 2:21 AM, Antoine Pitrou <[email protected]> wrote: > I would generally be -1 on some hacks. > Especially, str subclasses can leak to unsuspected places and create > weird issues (I remember an issue with BeautifulSoup, IIRC, which > returned str subclasses which kept whole HTML trees alive: by passing > those str objects around you would create yourself a huge memory leak). Agreed. I've done it in other projects for backward-compatibility reasons, but that doesn't really apply here. That's interesting about memory leaks. I would not have expected that. -eric _______________________________________________ Import-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/import-sig