Changes between Initial Version and Version 7 of Ticket #6579
- Timestamp:
- Jun 23, 2008, 1:00:12 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #6579
- Property Has patch set
- Property Triage Stage Unreviewed → Accepted
-
Ticket #6579 – Description
initial v7 1 In file templatetags/__init__.pythere is a line:1 In file {{{templatetags/__init__.py}}} there is a line: 2 2 {{{ 3 3 __path__.extend(__import__(a + '.templatetags', {}, {}, ['']).__path__) 4 4 }}} 5 5 6 __import__ method as fourth parameters gets a list of symbols to import. If this list is empty, __import__returns the top-level package, but if the list contains anything the specified package is returned as described in http://docs.python.org/lib/built-in-funcs.html . So in this file there is a hack where not empty list but list that contains 'something' is passed - list that contains single empty name.6 {{{__import__}}} method as fourth parameters gets a list of symbols to import. If this list is empty, {{{__import__}}} returns the top-level package, but if the list contains anything the specified package is returned as described in http://docs.python.org/lib/built-in-funcs.html . So in this file there is a hack where not empty list but list that contains 'something' is passed - list that contains single empty name. 7 7 8 But it causes some strange side-effects - the specified module is initialized twice. First with correct name and later with name followed by a dot (e.g. 'prog.app.templatetags' and 'prog.app.templatetags.'). In some cases it may cause serious problems.8 But it causes some strange side-effects - the specified module is initialized twice. First with correct name and later with name followed by a dot (e.g. {{{'prog.app.templatetags'}}} and {{{'prog.app.templatetags.'}}}). In some cases it may cause serious problems.