[ python-Bugs-1592533 ] Unfortunate naming of variable in heapq example
Bugs item #1592533, was opened at 2006-11-08 10:46 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=1592533&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: Martin Thorsen Ranang (ranang) Assigned to: Nobody/Anonymous (nobody) Summary: Unfortunate naming of variable in heapq example Initial Comment: In the current "Python Library Reference" documentation, in section "5.4 heapq -- Heap queue algorithm", an example goes: >>> sorted = [] >>> while heap: ... sorted.append(heappop(heap)) ... >>> print sorted [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] However, 'sorted' is the name of a built-in function. Of course, the example does not constitute an error, but it might be misleading to new users of the language. Consider: >>> sorted = [] >>> should_be_sorted = sorted([4, 3, 1, 2]) Traceback (most recent call last): File "", line 1, in ? TypeError: 'list' object is not callable >>> Hence, I suggest to rename the variable in the example to 'ordered'. Yours, Martin Thorsen Ranang -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1592533&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1592533 ] Unfortunate naming of variable in heapq example
Bugs item #1592533, was opened at 2006-11-08 09:46 Message generated for change (Comment added) made by gbrandl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1592533&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: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Martin Thorsen Ranang (ranang) >Assigned to: Georg Brandl (gbrandl) Summary: Unfortunate naming of variable in heapq example Initial Comment: In the current "Python Library Reference" documentation, in section "5.4 heapq -- Heap queue algorithm", an example goes: >>> sorted = [] >>> while heap: ... sorted.append(heappop(heap)) ... >>> print sorted [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] However, 'sorted' is the name of a built-in function. Of course, the example does not constitute an error, but it might be misleading to new users of the language. Consider: >>> sorted = [] >>> should_be_sorted = sorted([4, 3, 1, 2]) Traceback (most recent call last): File "", line 1, in ? TypeError: 'list' object is not callable >>> Hence, I suggest to rename the variable in the example to 'ordered'. Yours, Martin Thorsen Ranang -- >Comment By: Georg Brandl (gbrandl) Date: 2006-11-08 10:04 Message: Logged In: YES user_id=849994 Thanks! Fixed in rev. 52668, 52669 (2.5). -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1592533&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1592627 ] gettext has problems with .mo files that use non-ASCII chars
Bugs item #1592627, was opened at 2006-11-08 13:23 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=1592627&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: Parser/Compiler Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Russell Phillips (avantman42) Assigned to: Nobody/Anonymous (nobody) Summary: gettext has problems with .mo files that use non-ASCII chars Initial Comment: Hi, I'm trying to use gettext to internationalise my project [1], but I'm getting the following error message with some translations: "Traceback (most recent call last): file PanicButton.py line 36 in ? file Gettext.pyc line 177 in _init_ file Gettext.pyc line 274 in _parse struct.error : unpack str size does not match format" The snippet of code that loads the .mo file is below (full file is at [2]): # Code to find & install l10n file import gettext, os, locale, glob loc = locale.getdefaultlocale () sLocale = loc [0] #Use translation file with same name as locale if it exists if (os.path.exists (os.path.join ('locale', sLocale + '.mo'))): sLang = os.path.join ('locale', sLocale + '.mo') else: #find a .mo file that matches the first part (first three characters) of the locale sMoFiles = glob.glob (os.path.join ('locale', sLocale [:3] + '*.mo')) if (len (sMoFiles) > 0): sLang = sMoFiles [0] else: #Could not find exact or partial match for locale - use default translation file (British English) sLang = os.path.join ('locale', 'en_GB.mo') lan = gettext.GNUTranslations (open (sLang)) lan.install () # End of code to find & install l10n file The problem only seems to appear when the translated file uses non-ASCII characters. Full sourcecode is available via the SF.net project page [1], if required. The .po and .mo files are in the locale directory [3]. The only .mo file that does not have problems is en_GB.mo Russ [1] http://sourceforge.net/projects/panicbutton [2] http://panicbutton.cvs.sourceforge.net/panicbutton/panicbutton/PanicButton.py?view=log [3] http://panicbutton.cvs.sourceforge.net/panicbutton/panicbutton/locale/ -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1592627&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1590891 ] random.randrange don't return correct value for big number
Bugs item #1590891, was opened at 2006-11-05 08:54 Message generated for change (Comment added) made by josiahcarlson You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1590891&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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: MATSUI Tetsushi (mft) Assigned to: Raymond Hettinger (rhettinger) Summary: random.randrange don't return correct value for big number Initial Comment: Python 2.4.3 (#1, Oct 3 2006, 00:36:06) [GCC 4.1.1 (Gentoo 4.1.1-r1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> random.randrange(1, -1, -200) 267471051174796896L Obviously, the result is not in the specified range; 1 < 267471051174796896, -1 < 267471051174796896 and (267471051174796896 - 1) % (-200) != 0. I'm using 2.3.5 and 2.4.3, and their behaviors are identical. I haven't checked about 2.5. -- Comment By: Josiah Carlson (josiahcarlson) Date: 2006-11-08 08:45 Message: Logged In: YES user_id=341410 2.5 has the same behavior. One workaround (until it gets fixed) is to do the following... def myrandrange(start, stop, step): return start + random.randrange((stop-start)//step)*step random.randrange should change to do some variant of the above, given sane start, stop, step arguments. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1590891&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1591319 ] replace groups doesn't work in this special case
Bugs item #1591319, was opened at 2006-11-06 12:49 Message generated for change (Comment added) made by tomek74 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1591319&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 Private: No Submitted By: Thomas K. (tomek74) Assigned to: Gustavo Niemeyer (niemeyer) Summary: replace groups doesn't work in this special case Initial Comment: If you have a regular expression like this: ([0-9])([a-z])? matching this string: 1 1a and replacing with this: yx you get what expected: yx yx BUT: If you replace with this: \1\2 you get nothing replaced, because the group \2 doesn't exist for the pattern "1". But it does exist for the pattern "1a"! We have multiple possibilities here: 1.) The string "1" gives no result, because \2 doesn't exist. The string "1a" gives a result, so the output should be: 1a 2.) The sring "1" gives a result, because \2 is handled like an empty string. The string "1a" gives a result, so the output should be: 1 1a I think the case that the sring "1" has no results, but effects the string "1a" wich would normaly have a result, is bad. What are your thoughts on it? Test code: import re # common variables rawstr = r"""([0-9])([a-z])?""" embedded_rawstr = r"""([0-9])([a-z])?""" matchstr = """1 1a""" # method 1: using a compile object compile_obj = re.compile(rawstr) match_obj = compile_obj.search(matchstr) # method 2: using search function (w/ external flags) match_obj = re.search(rawstr, matchstr) # method 3: using search function (w/ embedded flags) match_obj = re.search(embedded_rawstr, matchstr) # Retrieve group(s) from match_obj all_groups = match_obj.groups() # Retrieve group(s) by index group_1 = match_obj.group(1) group_2 = match_obj.group(2) # Replace string newstr = compile_obj.subn('\1\2', 0) -- >Comment By: Thomas K. (tomek74) Date: 2006-11-08 17:56 Message: Logged In: YES user_id=22427 I have tried it again with my original regexp and the searchstring. In this case I have to put the “?” after “)”. -> RegEx: ([1-9][a-z][a-z][0-9])([ \-\r\n\t]*([0-9])(([0-9])(([0-9])([ \-\r\n\t]*([0-9])(([a-z])(([a-z])(([0-9])(([0-9])([ \-\r\n\t]*([0-9])(([a-z])(([a-z])(([0-9]))?)?)?)?)?)?)?)?)?)?)?)? IGNORECASE is switched on. -> ReplaceString: \1\3\5\7\9\11\13\15\17\19\21\23\25 -> Searchstring 1): 6ES5894-0MA63-0UG5 Result: 6ES58940MA630UG5 -> Searchstring 2): 6ES5894-0MA03; 6ES5864-0MA03; 6ES5894-0MA63-0UG5; 6ES58860MA03 Result: NO Result! -> The problem is that I get no results with searchstring 2. Thomas -- Comment By: Thomas K. (tomek74) Date: 2006-11-07 11:36 Message: Logged In: YES user_id=22427 I verified your code. It works for me, too. Sorry. -- Comment By: Gustavo Niemeyer (niemeyer) Date: 2006-11-06 13:17 Message: Logged In: YES user_id=7887 Hello Thomas, I don't understand exactly what you mean here. This doesn't work: >>> re.compile("([0-9])([a-z])?").subn(r"<\1\2>", "1 1a") Traceback (most recent call last): ... sre_constants.error: unmatched group And this works fine: >>> re.compile("([0-9])([a-z]?)").subn(r"<\1\2>", "1 1a") ('<1> <1a>', 2) The example code you provided doesn't run here, because 'subn()' is being provided bad data (check http://docs.python.org/lib/node46.html for docs). It's also being passed '\1\2', which is really '\x01\x02', and won't do what you want. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1591319&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Feature Requests-1592899 ] "".translate() docs should mention string.maketrans()
Feature Requests item #1592899, was opened at 2006-11-08 22:23 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1592899&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.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ori Avtalion (salty-horse) Assigned to: Nobody/Anonymous (nobody) Summary: "".translate() docs should mention string.maketrans() Initial Comment: The translate() documentation at http://docs.python.org/lib/string-methods.html#l2h-268 should mention the string.maketrans helper function. maketrans also mentions "regex.compile" - that should probably be "re.compile" (although it's less readable). re.compile should mention maketrans as well. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1592899&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1592627 ] gettext has problems with .mo files that use non-ASCII chars
Bugs item #1592627, was opened at 2006-11-08 14:23 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1592627&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: Parser/Compiler Group: None >Status: Pending >Resolution: Works For Me Priority: 5 Private: No Submitted By: Russell Phillips (avantman42) Assigned to: Nobody/Anonymous (nobody) Summary: gettext has problems with .mo files that use non-ASCII chars Initial Comment: Hi, I'm trying to use gettext to internationalise my project [1], but I'm getting the following error message with some translations: "Traceback (most recent call last): file PanicButton.py line 36 in ? file Gettext.pyc line 177 in _init_ file Gettext.pyc line 274 in _parse struct.error : unpack str size does not match format" The snippet of code that loads the .mo file is below (full file is at [2]): # Code to find & install l10n file import gettext, os, locale, glob loc = locale.getdefaultlocale () sLocale = loc [0] #Use translation file with same name as locale if it exists if (os.path.exists (os.path.join ('locale', sLocale + '.mo'))): sLang = os.path.join ('locale', sLocale + '.mo') else: #find a .mo file that matches the first part (first three characters) of the locale sMoFiles = glob.glob (os.path.join ('locale', sLocale [:3] + '*.mo')) if (len (sMoFiles) > 0): sLang = sMoFiles [0] else: #Could not find exact or partial match for locale - use default translation file (British English) sLang = os.path.join ('locale', 'en_GB.mo') lan = gettext.GNUTranslations (open (sLang)) lan.install () # End of code to find & install l10n file The problem only seems to appear when the translated file uses non-ASCII characters. Full sourcecode is available via the SF.net project page [1], if required. The .po and .mo files are in the locale directory [3]. The only .mo file that does not have problems is en_GB.mo Russ [1] http://sourceforge.net/projects/panicbutton [2] http://panicbutton.cvs.sourceforge.net/panicbutton/panicbutton/PanicButton.py?view=log [3] http://panicbutton.cvs.sourceforge.net/panicbutton/panicbutton/locale/ -- >Comment By: Martin v. Löwis (loewis) Date: 2006-11-08 22:45 Message: Logged In: YES user_id=21627 I can't reproduce the problem. If I understand your description correctly, then this line should fail py> gettext.GNUTranslations(open("de_DE.mo")) However, it doesn't fail for me, neither with Python 2.4.4 or 2.5. Are you, by any chance, using Microsoft Windows? If so, you should open the file in binary mode (you should actually do so on all systems; .mo files are binary): gettext.GNUTranslations (open (sLang, 'rb')) Also, I'm puzzled by your traceback. It says file Gettext.pyc line 177 in _init_ file Gettext.pyc line 274 in _parse However, Python does not include a file named Gettext.py[c], only gettext.py (lower case 'g'). Where did you get Gettext.pyc from? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1592627&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1591122 ] problem building python in vs8express
Bugs item #1591122, was opened at 2006-11-06 05:31 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1591122&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: Build Group: Python 2.5 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Thomas Southern (thomashsouthern) Assigned to: Nobody/Anonymous (nobody) Summary: problem building python in vs8express Initial Comment: When I tried to build pythoncore in vc++8 express, it worked without a hitch until the link stage when i got an unresolved external _init_types. Python compiles just fine and pythonw compiles up to the link where it comes accross the same error. If I am suppose to contact someone else about my issue please sent me in the wright direction. my email is [EMAIL PROTECTED] -- >Comment By: Martin v. Löwis (loewis) Date: 2006-11-08 22:51 Message: Logged In: YES user_id=21627 If you want to check out the sources, you should familiarize yourself with subversion. With a command line client, the checkout line would be svn co http://svn.python.org/projects/python/trunk or svn co http://svn.python.org/projects/python/branches/release25-maint If you want to use TortoiseSVN, just use the URL in the checkout dialog. This problem is fixed both in the trunk and the 2.5 branch, so you may just wait for 2.5.1 being released (which will happen some time next year). Closing as fixed. -- Comment By: Thomas Southern (thomashsouthern) Date: 2006-11-08 02:14 Message: Logged In: YES user_id=1638546 thank you for your responses. after I answered your first question i went in search of the svn head for this project. I started at www.python.org and went to the developement area. I found svn trunk where the files for python 2.6 were located. I appolgize if I appear ignorant but I have never been interested in an open source project enough to want to compile from scratch and maybe even try and see what I could contribute. I don't know if I found the right area. where I did find. I would need to download each file individually. also, the "solution items" with "getbuildinfo.c" was not recognized by the vc++ express compiler. My question is this, am I looking in the correct location for the files I am looking for to build the source myself. also if this brings me out of the preview of the purpose of this thread please direct me to the proper location to continue to ask questions I might have as I try to understand my way around this project. thank you for your patients and help. -- Comment By: Georg Brandl (gbrandl) Date: 2006-11-07 16:41 Message: Logged In: YES user_id=849994 So could you please retry with the SVN HEAD? -- Comment By: Thomas Southern (thomashsouthern) Date: 2006-11-07 01:59 Message: Logged In: YES user_id=1638546 I am using python 2.5 -- Comment By: Georg Brandl (gbrandl) Date: 2006-11-06 08:46 Message: Logged In: YES user_id=849994 Which version of the sources are you using? I think this is fixed in the SVN HEAD. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1591122&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1590891 ] random.randrange don't return correct value for big number
Bugs item #1590891, was opened at 2006-11-05 16:54 Message generated for change (Comment added) made by arigo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1590891&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: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: MATSUI Tetsushi (mft) Assigned to: Raymond Hettinger (rhettinger) Summary: random.randrange don't return correct value for big number Initial Comment: Python 2.4.3 (#1, Oct 3 2006, 00:36:06) [GCC 4.1.1 (Gentoo 4.1.1-r1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> random.randrange(1, -1, -200) 267471051174796896L Obviously, the result is not in the specified range; 1 < 267471051174796896, -1 < 267471051174796896 and (267471051174796896 - 1) % (-200) != 0. I'm using 2.3.5 and 2.4.3, and their behaviors are identical. I haven't checked about 2.5. -- >Comment By: Armin Rigo (arigo) Date: 2006-11-08 22:22 Message: Logged In: YES user_id=4771 Oups. If the interval is very large, the step is ignored. Patch attached... -- Comment By: Josiah Carlson (josiahcarlson) Date: 2006-11-08 16:45 Message: Logged In: YES user_id=341410 2.5 has the same behavior. One workaround (until it gets fixed) is to do the following... def myrandrange(start, stop, step): return start + random.randrange((stop-start)//step)*step random.randrange should change to do some variant of the above, given sane start, stop, step arguments. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1590891&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1572320 ] parser stack overflow
Bugs item #1572320, was opened at 2006-10-06 14:37 Message generated for change (Comment added) made by jackdied You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1572320&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: Build Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: j�rgen urner (cereb_00) Assigned to: Nobody/Anonymous (nobody) Summary: parser stack overflow Initial Comment: Executing this raw (malformed) tuple raises: s_push: parser stack overflow MemoryError instead of SyntaxError. Sorry for not tracking it down more, but the tuple was actually much longer, so I did at least a bit of that. Removing the last member raises SyntaxError as expected. ( ("indigo", "#4B0082)", ("gold", "#FFD700)", ("firebrick", "#B2)", ("indianred", "#CD5C5C)", ("yellow", "#00)", ("darkolivegreen", "#556B2F)", ("darkseagreen", "#8FBC8F)", ("mediumvioletred", "#C71585)", ("mediumorchid", "#BA55D3)", ("chartreuse", "#7FFF00)", ("mediumslateblue", "#7B68EE)", ("black", "#00)", ("springgreen", "#00FF7F)", ("crimson", "#DC143C)", ("lightsalmon", "#FFA07A)", ("brown", "#A52A2A)", ("turquoise", "#40E0D0)", ("olivedrab", "#6B8E23)", ("silver", "#C0C0C0)", ("skyblue", "#87CEEB)", ("gray", "#808080)", ("darkturquoise", "#00CED1)", ("goldenrod", "#DAA520)", ("darkgreen", "#006400)", ("darkviolet", "#9400D3)", ("darkgray", "#A9A9A9)", ("lime", "#00FF00)", ("lightpink", "#FFB6C1)", ("teal", "#008080)", ("darkmagenta", "#8B008B)", ("lightgoldenrodyellow", "#FAFAD2)", ("lavender", "#E6E6FA)", ) -- Comment By: Jack Diederich (jackdied) Date: 2006-11-08 18:38 Message: Logged In: YES user_id=591932 Here is a simpler testcase (() -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1572320&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1593035 ] readline problem on ia64-unknown-linux-gnu
Bugs item #1593035, was opened at 2006-11-08 18:48 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=1593035&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 Interpreter Core Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kate Minola (kate01123) Assigned to: Nobody/Anonymous (nobody) Summary: readline problem on ia64-unknown-linux-gnu Initial Comment: On my ia64-unknown-linux-gnu machine, running python-2.5, if I import the following code (foo.py) and then try to do file name completion, I get a segmentation fault. Specifically, if after importing foo.py, if I type "im" and then [tab], I get a segmentation fault. I built python-2.5 from source using the default values. (All I did was "configure", then "make".) This does NOT happen under python-2.4.4. - foo.py -- try: import rlcompleter,readline except ImportError: print '*** No readline support ***' pass else: readline.set_history_length(1000) # parse and bind all these: rlcmds = ['tab: complete', r'"\M-p": history-search-backward', r'"\M-n": history-search-forward', r'"\C-p": history-search-backward', r'"\C-n": history-search-forward', r'"\e[A": history-search-backward', r'"\e[B": history-search-forward', 'set show-all-if-ambiguous on', ] map(readline.parse_and_bind,rlcmds) --- %uname -a Linux lepidus 2.4.21-sgi302r24 #1 SMP Fri Oct 22 22:43:12 PDT 2004 ia64 ia64 ia64 GNU/Linux % % ./python --version Python 2.5 % % ./python Python 2.5 (r25:51908, Nov 8 2006, 15:40:13) [GCC 4.1.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import foo >>> impSegmentation fault (core dumped) % % gdb ./python GNU gdb Red Hat Linux (6.0post-0.20040223.20rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) r Starting program: /home/kate/sage/william/Python-2.5/python [Thread debugging using libthread_db enabled] [New Thread 2305843009213881680 (LWP 23166)] Python 2.5 (r25:51908, Nov 8 2006, 15:40:13) [GCC 4.1.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import foo >>> im Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 2305843009213881680 (LWP 23166)] 0x2264ae90 in rl_complete_internal () from /usr/lib/libreadline.so.4 (gdb) bt #0 0x2264ae90 in rl_complete_internal () from /usr/lib/libreadline.so.4 #1 0x22646d90 in rl_complete () from /usr/lib/libreadline.so.4 #2 0x2263bc40 in _rl_dispatch_subseq () from /usr/lib/libreadline.so.4 #3 0x2263b780 in _rl_dispatch () from /usr/lib/libreadline.so.4 #4 0x2263af90 in readline_internal_char () from /usr/lib/libreadline.so.4 #5 0x in ?? () (gdb) Kate Minola University of Maryland, College Park -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1593035&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Feature Requests-449227 ] rlcompleter add " (" to callables feature
Feature Requests item #449227, was opened at 2001-08-08 18:04 Message generated for change (Comment added) made by rnd0110 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=449227&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 Private: No Submitted By: Roman Suzi (rnd0110) Assigned to: Nobody/Anonymous (nobody) Summary: rlcompleter add "(" to callables feature Initial Comment: I use rlcompleter extensively in interactive Python mode. I think it could be cool if callable objects were added "(" when completed. This way it will be much faster to program, without looking-up __doc__. For example: >>> f.filwill give: >>> f.fileno(_ ("_" is to mark cursor position) and: >>> f.so will (as before) give: >>> f.softspace _ -- >Comment By: Roman Suzi (rnd0110) Date: 2006-11-09 06:58 Message: Logged In: YES user_id=287815 Perhaps one needs to propose a patch. Otherwise it will not advance... -- Comment By: Georg Brandl (birkenfeld) Date: 2005-07-17 13:15 Message: Logged In: YES user_id=1188172 Any comments on this one? Sounds reasonable to me. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=449227&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Feature Requests-449227 ] rlcompleter add " (" to callables feature
Feature Requests item #449227, was opened at 2001-08-08 18:04 Message generated for change (Comment added) made by rnd0110 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=449227&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 Private: No Submitted By: Roman Suzi (rnd0110) Assigned to: Nobody/Anonymous (nobody) Summary: rlcompleter add "(" to callables feature Initial Comment: I use rlcompleter extensively in interactive Python mode. I think it could be cool if callable objects were added "(" when completed. This way it will be much faster to program, without looking-up __doc__. For example: >>> f.filwill give: >>> f.fileno(_ ("_" is to mark cursor position) and: >>> f.so will (as before) give: >>> f.softspace _ -- >Comment By: Roman Suzi (rnd0110) Date: 2006-11-09 07:01 Message: Logged In: YES user_id=287815 Wow! The patch is here! Why isn't is accepted into the distribution??? -- Comment By: Roman Suzi (rnd0110) Date: 2006-11-09 06:58 Message: Logged In: YES user_id=287815 Perhaps one needs to propose a patch. Otherwise it will not advance... -- Comment By: Georg Brandl (birkenfeld) Date: 2005-07-17 13:15 Message: Logged In: YES user_id=1188172 Any comments on this one? Sounds reasonable to me. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=449227&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Feature Requests-449227 ] rlcompleter add " (" to callables feature
Feature Requests item #449227, was opened at 2001-08-08 18:04 Message generated for change (Comment added) made by rnd0110 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=449227&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.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Roman Suzi (rnd0110) Assigned to: Nobody/Anonymous (nobody) Summary: rlcompleter add "(" to callables feature Initial Comment: I use rlcompleter extensively in interactive Python mode. I think it could be cool if callable objects were added "(" when completed. This way it will be much faster to program, without looking-up __doc__. For example: >>> f.filwill give: >>> f.fileno(_ ("_" is to mark cursor position) and: >>> f.so will (as before) give: >>> f.softspace _ -- >Comment By: Roman Suzi (rnd0110) Date: 2006-11-09 07:57 Message: Logged In: YES user_id=287815 One more illustration: >>> f = open("myfile", "w") >>> f. f.__class__( f.__repr__( f.next( f.__delattr__( f.__setattr__( f.read( f.__doc__f.__str__( f.readinto( f.__enter__( f.close( f.readline( f.__exit__( f.closed f.readlines( f.__getattribute__( f.encoding f.seek( f.__hash__( f.fileno(f.softspace f.__init__( f.flush( f.tell( f.__iter__( f.isatty(f.truncate( f.__new__( f.mode f.write( f.__reduce__(f.name f.writelines( f.__reduce_ex__( f.newlines f.xreadlines( >>> f. - nice to remember which attributes are methods and which aren't. -- Comment By: Roman Suzi (rnd0110) Date: 2006-11-09 07:01 Message: Logged In: YES user_id=287815 Wow! The patch is here! Why isn't is accepted into the distribution??? -- Comment By: Roman Suzi (rnd0110) Date: 2006-11-09 06:58 Message: Logged In: YES user_id=287815 Perhaps one needs to propose a patch. Otherwise it will not advance... -- Comment By: Georg Brandl (birkenfeld) Date: 2005-07-17 13:15 Message: Logged In: YES user_id=1188172 Any comments on this one? Sounds reasonable to me. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=449227&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com