Antoine Pitrou <pit...@free.fr> added the comment: > 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) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9548> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com