Author pitrou
Recipients brett.cannon, lemburg, mark.dickinson, orsenthil, pitrou, rhettinger, vstinner
Date 2010-08-09.21:30:21
SpamBayes Score 1.80617e-11
Marked as misclassified No
Message-id <1281389418.3173.5.camel@localhost.localdomain>
In-reply-to <4C606701.9060205@egenix.com>
Content
> I don't think that's the right way forward.
> 
> It's much easier to either remove the need to import those
> extra modules or defer their import to actual use within
> a function.

The latter has various issues, such as being overly tedious and
potentially risk (because of the import lock).
Furthermore, functools.wraps is used as a decorator at the toplevel of
locale.py, which makes it currently unremovable.

The former is easier said than done, and we may end up writing poor
man's reimplementations of some stdlib functions.

> It would be worthwhile adding a note to the top of the module
> mentioning the fact that the module is loaded early on by Python
> and to warn about use of non-builtin module imports.

Use of non-builtin stdlib modules is legitimate for many functions which
aren't used in the startup process anyway. The rationale behind the
patch is precisely to define a subset that is needed at startup and
shouldn't rely on stdlib facilities. The rest of the locale module is
allowed to use whatever stdlib facilities it desires, which is always
much more practical.

(note, this is already done elsewhere, for example _abcoll.py or
_weakrefset.py)
History
Date User Action Args
2010-08-09 21:30:24pitrousetrecipients: + pitrou, lemburg, brett.cannon, rhettinger, mark.dickinson, orsenthil, vstinner
2010-08-09 21:30:22pitroulinkissue9548 messages
2010-08-09 21:30:21pitroucreate