[ python-Bugs-1326841 ] SIGALRM alarm signal kills interpreter
Bugs item #1326841, was opened at 2005-10-14 16:48 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1326841&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: Demos and Tools Group: None >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: paul rubin (phr) Assigned to: Nobody/Anonymous (nobody) Summary: SIGALRM alarm signal kills interpreter Initial Comment: This may be similar to #210641. Example (Python 2.4.1, Fedora Core 4 GNU/Linux): sh-3.00$ python Python 2.4.1 (#1, May 16 2005, 15:19:29) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> signal.alarm(1) # 1 second passes... 0 >>> Alarm clock sh-3.00$ # python has exited Doing the same thing in IDLE results in the subprocess restarting. IMO the correct behavior would be to raise an exception that the outer shell would catch. -- >Comment By: Martin v. Löwis (loewis) Date: 2005-10-15 17:53 Message: Logged In: YES user_id=21627 This is not a bug. It is documented that way: the default handler is SIG_DFL, which in turn does the system default for the signal. For Sigalarm, it is to terminate the process. If you want an exception raised, you need to install a signal handler: >>> def doalarm(signum,frame): ... raise "alarm" ... >>> signal.signal(signal.SIGALRM, doalarm) >>> signal.alarm(3) 0 >>> Traceback (most recent call last): File "", line 0, in ? File "", line 2, in doalarm alarm -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1326841&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-1296581 ] datetime.replace could take a dict
Feature Requests item #1296581, was opened at 2005-09-20 18:56 Message generated for change (Settings changed) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1296581&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: 1 Submitted By: Tom Lynn (tlynn) >Assigned to: Nobody/Anonymous (nobody) Summary: datetime.replace could take a dict Initial Comment: Python 2.4.1. datetime.replace uses its kwargs to specify the fields, which I found a bit surprising. It could also take an equivalent dict. (Failing that, it could have a fuller docstring.) What I was actually trying to do was round to the nearest half hour. floor and ceil methods taking a timedelta would be nice too. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1296581&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-1296581 ] datetime.replace could take a dict
Feature Requests item #1296581, was opened at 2005-09-20 11:56 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1296581&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: Invalid Priority: 1 Submitted By: Tom Lynn (tlynn) Assigned to: Nobody/Anonymous (nobody) Summary: datetime.replace could take a dict Initial Comment: Python 2.4.1. datetime.replace uses its kwargs to specify the fields, which I found a bit surprising. It could also take an equivalent dict. (Failing that, it could have a fuller docstring.) What I was actually trying to do was round to the nearest half hour. floor and ceil methods taking a timedelta would be nice too. -- >Comment By: Raymond Hettinger (rhettinger) Date: 2005-10-15 21:20 Message: Logged In: YES user_id=80475 Any function accepting keyword arguments can already be called with an equivalent dict using the ** notation (similar to tuple unpacking): >>> from datetime import date >>> d = dict(day=26, year=2004) >>> date(2001, 1, 2).replace(**d) datetime.date(2004, 1, 26) -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1296581&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-1326830 ] python scratchpad (IDLE)
Feature Requests item #1326830, was opened at 2005-10-14 10:38 Message generated for change (Comment added) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1326830&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: IDLE Group: None Status: Open >Resolution: Rejected Priority: 5 Submitted By: paul rubin (phr) >Assigned to: Kurt B. Kaiser (kbk) >Summary: python scratchpad (IDLE) Initial Comment: Lots of times I want to use Idle sort of like a Mathematica notebook but for Python. That is, I want to enter some code and interactively run it, edit it, run it some more, etc. Then, at the end, I typically don't want to save it. It's like doing a calculation on scratch paper and throwing away the paper after finding the answer. It's a bit of a pain to have to explicitly save such code in a file, going through the whole file dialog, after launching to a Python editor window. Most word processors will generate an automatic filename like "Untitled", or "Untitled-1", "Untitled-2", etc., if "Untitled" already exists. That makes the dialog a bit more streamlined. It would be nice if this type of operation were easier in IDLE. I'm not sure of the exact best way. Here are some: 1) Have a default filename ("Untitled-.py" for example) that saves to the user's home dir, or home/.idle, or maybe some configurable place. User could click to confirm (that's probably the easiest) or IDLE could display some kind of message (preferable) that doesn't need user interaction. IDLE has no status bar right now so maybe it would need one in order to display such a message conveniently. I guess the message could be displayed in the Python shell (by sending an appropriate print statement to the subprocess) if the user saves by hitting F5 to run the program. 2) (this is perhaps questionable) The default place to save the file could be in /tmp. On hitting F5, the Python shell would print a message noting that the file was only in /tmp and hadn't been saved anyplace permanent. -- >Comment By: Kurt B. Kaiser (kbk) Date: 2005-10-16 00:51 Message: Logged In: YES user_id=149084 You're breaking my heart. Pick a file name (how about reserving 'f'?) Select IDLE's autosave feature in the Options dialog. When you F5 a new edit window, and the Source Must be Saved dialog comes up, hit enter, type an 'f', hit enter. Three keystrokes. Maybe sometime I'll remove the Source Must be Saved dialog if IDLE is set to Autosave, then it would be two keystrokes. The downside to implementing this is some poor soul is going to lose significant work that he thought was saved. Guido wan't even very happy with Autosave, though I love it. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1326830&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-1326830 ] python scratchpad (IDLE)
Feature Requests item #1326830, was opened at 2005-10-14 10:38 Message generated for change (Settings changed) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1326830&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: IDLE Group: None >Status: Closed Resolution: Rejected Priority: 5 Submitted By: paul rubin (phr) Assigned to: Kurt B. Kaiser (kbk) Summary: python scratchpad (IDLE) Initial Comment: Lots of times I want to use Idle sort of like a Mathematica notebook but for Python. That is, I want to enter some code and interactively run it, edit it, run it some more, etc. Then, at the end, I typically don't want to save it. It's like doing a calculation on scratch paper and throwing away the paper after finding the answer. It's a bit of a pain to have to explicitly save such code in a file, going through the whole file dialog, after launching to a Python editor window. Most word processors will generate an automatic filename like "Untitled", or "Untitled-1", "Untitled-2", etc., if "Untitled" already exists. That makes the dialog a bit more streamlined. It would be nice if this type of operation were easier in IDLE. I'm not sure of the exact best way. Here are some: 1) Have a default filename ("Untitled-.py" for example) that saves to the user's home dir, or home/.idle, or maybe some configurable place. User could click to confirm (that's probably the easiest) or IDLE could display some kind of message (preferable) that doesn't need user interaction. IDLE has no status bar right now so maybe it would need one in order to display such a message conveniently. I guess the message could be displayed in the Python shell (by sending an appropriate print statement to the subprocess) if the user saves by hitting F5 to run the program. 2) (this is perhaps questionable) The default place to save the file could be in /tmp. On hitting F5, the Python shell would print a message noting that the file was only in /tmp and hadn't been saved anyplace permanent. -- Comment By: Kurt B. Kaiser (kbk) Date: 2005-10-16 00:51 Message: Logged In: YES user_id=149084 You're breaking my heart. Pick a file name (how about reserving 'f'?) Select IDLE's autosave feature in the Options dialog. When you F5 a new edit window, and the Source Must be Saved dialog comes up, hit enter, type an 'f', hit enter. Three keystrokes. Maybe sometime I'll remove the Source Must be Saved dialog if IDLE is set to Autosave, then it would be two keystrokes. The downside to implementing this is some poor soul is going to lose significant work that he thought was saved. Guido wan't even very happy with Autosave, though I love it. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1326830&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1325071 ] "as" keyword sometimes highlighted in strings
Bugs item #1325071, was opened at 2005-10-12 13:45 Message generated for change (Settings changed) made by kbk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1325071&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: IDLE Group: None Status: Open Resolution: None >Priority: 3 Submitted By: Artur de Sousa Rocha (adsr) Assigned to: Kurt B. Kaiser (kbk) Summary: "as" keyword sometimes highlighted in strings Initial Comment: IDLE sometimes highlights the "as" keyword inside strings. See the docstring to the get_redir() function in the attached script. IDLE 1.1.2, Python 2.4.2, but I've seen it in older versions too. -- Comment By: Raymond Hettinger (rhettinger) Date: 2005-10-14 03:20 Message: Logged In: YES user_id=80475 It is better to have fast and simple syntax highlighting which does not special-case literals. IOW, I prefer the status quo -- it would be a loss to have the highlighting code get mired down with parser logic. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1325071&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com