[ python-Feature Requests-1602189 ] Suggest a textlist() method for ElementTree
Feature Requests item #1602189, was opened at 2006-11-24 05:00 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1602189&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: Python 2.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Raymond Hettinger (rhettinger) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Suggest a textlist() method for ElementTree Initial Comment: This patch has a implementation and example for a method to recursively extract prose from nested XML markup. This improves the utility of ElementTree for documents where otherwise contiguous PCDATA are broken-up by inspersed tags (e.g. xhtml or docbook fragments). See attached file or the ASPN recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498286 -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1602189&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1602378 ] Incorrect docs for bisect_left
Bugs item #1602378, was opened at 2006-11-24 09:07 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=1602378&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.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Daniel Eloff (eloff) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect docs for bisect_left Initial Comment: Quote: Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, i points just before the leftmost x already there. The last sentence is incorrect, and it contradicts what comes earlier. Not knowing which is correct, I had to test it in the shell. >>> from bisect import * >>> l = [1,2,3,3,3,4,5] >>> bisect_left(l,3) 2 >>> l[2:] [3, 3, 3, 4, 5] It should be changed to read "i points at the leftmost x already there" -Dan -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1602378&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1602378 ] Incorrect docs for bisect_left
Bugs item #1602378, was opened at 2006-11-24 12:07 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1602378&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.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Daniel Eloff (eloff) >Assigned to: Raymond Hettinger (rhettinger) Summary: Incorrect docs for bisect_left Initial Comment: Quote: Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, i points just before the leftmost x already there. The last sentence is incorrect, and it contradicts what comes earlier. Not knowing which is correct, I had to test it in the shell. >>> from bisect import * >>> l = [1,2,3,3,3,4,5] >>> bisect_left(l,3) 2 >>> l[2:] [3, 3, 3, 4, 5] It should be changed to read "i points at the leftmost x already there" -Dan -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1602378&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1598620 ] ctypes Structure allows recursive definition
Bugs item #1598620, was opened at 2006-11-17 22:26
Message generated for change (Comment added) made by theller
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1598620&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: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Lenard Lindstrom (kermode)
Assigned to: Thomas Heller (theller)
Summary: ctypes Structure allows recursive definition
Initial Comment:
Ctypes version 1.0.1 and Python 2.4:
A Partially declared structure can be used as a type
in its own field declarations:
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>> from ctypes import Structure, c_int, sizeof, __version__
>>> __version__
'1.0.1'
>>> class S(Structure):
... pass
...
>>> S._fields_ = [('i', c_int), ('s', S)]
>>> sizeof(S)
4
>>> o=S(7)
>>> o.s.i=12
>>> o.s.s.i=20
>>> o.i
7
>>> o.s.i
12
>>> o.s.s.i
20
>>> sizeof(o)
4
--
>Comment By: Thomas Heller (theller)
Date: 2006-11-24 20:04
Message:
Logged In: YES
user_id=11105
Originator: NO
Fixed now in SVN, rev 52841 (trunk) and rev 52842 (release25-maint).
Thanks for the report.
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1598620&group_id=5470
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1602378 ] Incorrect docs for bisect_left
Bugs item #1602378, was opened at 2006-11-24 12:07 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1602378&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.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Daniel Eloff (eloff) Assigned to: Raymond Hettinger (rhettinger) Summary: Incorrect docs for bisect_left Initial Comment: Quote: Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in a[i:] have e >= x. So if x already appears in the list, i points just before the leftmost x already there. The last sentence is incorrect, and it contradicts what comes earlier. Not knowing which is correct, I had to test it in the shell. >>> from bisect import * >>> l = [1,2,3,3,3,4,5] >>> bisect_left(l,3) 2 >>> l[2:] [3, 3, 3, 4, 5] It should be changed to read "i points at the leftmost x already there" -Dan -- >Comment By: Tim Peters (tim_one) Date: 2006-11-24 14:16 Message: Logged In: YES user_id=31435 Originator: NO The docs are written from the POV that indices in Python point /between/ array elements, which is the easiest way to understand slices, and that there are n+1 non-negative indices that "make obvious sense" in slices of a sequence with n elements: index 0 points "just before" element a[0], and index n "just after" element a[n-1], while for 0 < i < n-1, index i points "just before" element [i] /and/ "just after" element a[i-1]. This is also the sanest way to understand the return value of the bisect functions, which again can return n+1 values given a sequence with n elements. That said, I agree the docs are cryptic if you don't understand that first. I'm not sure this is the best place to explain it. The specific line in question could be "repaired" by saying a[i] is the leftmost x already there, identifying one of the n elements instead of one of the n+1 sequence positions. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1602378&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1570417 ] 2.4 & 2.5 can't create win installer on linux
Bugs item #1570417, was opened at 2006-10-04 05:45 Message generated for change (Comment added) made by theller You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1570417&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: Distutils Group: Python 2.4 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Richard Jones (richard) Assigned to: Thomas Heller (theller) Summary: 2.4 & 2.5 can't create win installer on linux Initial Comment: With python 2.4.3 and 2.5 I can't build a Windows installer on Linux. I get the following error: Warning: Can't read registry to find the necessary compiler setting Make sure that Python modules _winreg, win32api or win32con are installed. removing 'build/bdist.linux-i686/wininst' (and everything under it) I can still create an installer with 2.3.5 -- >Comment By: Thomas Heller (theller) Date: 2006-11-24 20:39 Message: Logged In: YES user_id=11105 Originator: NO Can this be closed, Martin? When I try 'setup.py bdist_wininst' on Linux, I get the warning but an exe is built. -- Comment By: Thomas Heller (theller) Date: 2006-10-05 21:34 Message: Logged In: YES user_id=11105 For pure distributions, bdist_wininst should create installers that are independent on the Python version. This worked up to Python 2.3, starting with 2.4 problems could arise because different MS C runtime libs are used. So, to fix this problem, even for pure distributions it should be required to specify the target-version command line switch. When building on non-windows systems, or even on Windows systems for another Python version than the one used to build the installer, bdist_wininst.py could hardcode the knowledge about Python version/MSVC version for the official python.org releases. This will fail if someone builds his own version of Python, for example 2.5 with MSVC 8. The real solution would be to avoid having wininst-XXX.exe use the C runtime library at all. OTOH, in my experience using the wrong C runtime library only has small effects - the installer would fail to show output from the pre- or post-install scripts (if they are used at all). -- Comment By: Martin v. Löwis (loewis) Date: 2006-10-04 08:30 Message: Logged In: YES user_id=21627 The message you get is a warning only; you can ignore it. However, it still fails because it can't determine what msvcrt version the target python was built with. It needs to find that out because it needs to decide whether to use wininst-6.exe or wininst-7.1.exe. Thomas, can you think of a way to fix this? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1570417&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
