[ python-Bugs-1234985 ] using some_re.sub() often imports sre.__doc__

2005-07-24 Thread SourceForge.net
Bugs item #1234985, was opened at 2005-07-08 23:46
Message generated for change (Comment added) made by pterk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1234985&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Regular Expressions
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Alexander (stevea_zope)
Assigned to: Gustavo Niemeyer (niemeyer)
Summary: using some_re.sub() often imports sre.__doc__

Initial Comment:
Why is __doc__ imported from the builtin sre module
when a regular expression is substituted replacing a group?


$ python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.

>>> def import_hook(name, globals={}, locals={},
fromlist=[]):
... print name, fromlist
... return original_import(name, globals, locals,
fromlist)
...
>>> import __builtin__
>>> original_import = __builtin__.__import__
>>> __builtin__.__import__ = import_hook

>>> import re
re None
sre ('*',)
sys None
sre_compile None
_sre None
sys None
sre_constants ('*',)
sre_parse None
sys None
sre_constants ('*',)
sre_parse None
copy_reg None
sre ('__all__',)

>>> re1 = re.compile('foo...bar')
sre_parse None

>>> re1.sub('x', 'y')
'y'
>>> re1.sub('x', 'fooXXXbar')
'x'

>>> re2 = re.compile('foo(...)bar')
sre_parse None
>>> re2.sub('x', 'y')
'y'
>>> re2.sub('\1', 'fooXXXbar')
sre ['__doc__']
'XXX'


--

Comment By: Peter van Kampen (pterk)
Date: 2005-07-24 14:27

Message:
Logged In: YES 
user_id=174455

Below is the full source of re.py. Does your problem go away
when you use sre directly instead? 

"""Minimal "re" compatibility wrapper.  See "sre" for
documentation."""

engine = "sre" # Some apps might use this undocumented variable

from sre import *
from sre import __all__

--

Comment By: Steve Alexander (stevea_zope)
Date: 2005-07-08 23:52

Message:
Logged In: YES 
user_id=492001

This is significant for programs that use an expensive
import hook, and also use this kind of regex.

I'm working around this by making my import hook return
early for imports from sre.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1234985&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1243553 ] pydoc on cgi.escape lacks info that are in www docs

2005-07-24 Thread SourceForge.net
Bugs item #1243553, was opened at 2005-07-23 14:33
Message generated for change (Comment added) made by pterk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243553&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nikos Kouremenos (nkour)
Assigned to: Nobody/Anonymous (nobody)
Summary: pydoc on cgi.escape lacks info that are in www docs

Initial Comment:
WWW:

escape( s[, quote])
Convert the characters "&", "<" and ">" in string s
to HTML-safe sequences. Use this if you need to display
text that might contain such characters in HTML. If the
optional flag quote is true, the double-quote character
(""") is also translated; this helps for inclusion in
an HTML attribute value, as in . If the
value to be quoted might include single- or
double-quote characters, or both, consider using the
quoteattr() function in the xml.sax.saxutils module
instead.


pydoc
cgi.escape = escape(s, quote=None)
Replace special characters '&', '<' and '>' by SGML
entities.


why? ;(

moreover pydoc doesn't even say what quote is!!

--

Comment By: Peter van Kampen (pterk)
Date: 2005-07-24 14:55

Message:
Logged In: YES 
user_id=174455

The documentation from pydoc is generated from doc-strings
in the python source. Not only does this limit what you can
do with it (hence the need for more elaborate
documentation), it is also reasonable that this
documentation remains terse. You should consider it more as
a quick reference in stead of full-on documentation. 

I have submitted a small patch (1243910) to include a
comment in the doc-string about quote.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243553&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1243553 ] pydoc on cgi.escape lacks info that are in www docs

2005-07-24 Thread SourceForge.net
Bugs item #1243553, was opened at 2005-07-23 15:33
Message generated for change (Comment added) made by nkour
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243553&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nikos Kouremenos (nkour)
Assigned to: Nobody/Anonymous (nobody)
Summary: pydoc on cgi.escape lacks info that are in www docs

Initial Comment:
WWW:

escape( s[, quote])
Convert the characters "&", "<" and ">" in string s
to HTML-safe sequences. Use this if you need to display
text that might contain such characters in HTML. If the
optional flag quote is true, the double-quote character
(""") is also translated; this helps for inclusion in
an HTML attribute value, as in . If the
value to be quoted might include single- or
double-quote characters, or both, consider using the
quoteattr() function in the xml.sax.saxutils module
instead.


pydoc
cgi.escape = escape(s, quote=None)
Replace special characters '&', '<' and '>' by SGML
entities.


why? ;(

moreover pydoc doesn't even say what quote is!!

--

>Comment By: Nikos Kouremenos (nkour)
Date: 2005-07-24 16:20

Message:
Logged In: YES 
user_id=865368

pterk, thank you

--

Comment By: Peter van Kampen (pterk)
Date: 2005-07-24 15:55

Message:
Logged In: YES 
user_id=174455

The documentation from pydoc is generated from doc-strings
in the python source. Not only does this limit what you can
do with it (hence the need for more elaborate
documentation), it is also reasonable that this
documentation remains terse. You should consider it more as
a quick reference in stead of full-on documentation. 

I have submitted a small patch (1243910) to include a
comment in the doc-string about quote.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243553&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1243945 ] Python function/method/constant names as HTML-tag IDs

2005-07-24 Thread SourceForge.net
Bugs item #1243945, was opened at 2005-07-24 11:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243945&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Chad Miller (chadmiller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python function/method/constant names as HTML-tag IDs

Initial Comment:
It would be very nice if HTML tag IDs were predictable,
and not generated.  For instance, when newbie-Joe
complains on IRC about his program, I'd much rather be
able to point him to 

http://python.org/doc/current/lib/built-in-funcs#input

instead of 

http://python.org/doc/current/lib/built-in-funcs#l2h-38

or telling him to find it manually.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1243945&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com