[issue21756] IDLE - ParenMatch fails to find closing paren of multi-line statements

2014-06-14 Thread Tal Einat
New submission from Tal Einat: Originally reported on issue #21694. Regarding, for example, the following code: (3 + 4 - 1) Placing the cursor after the opening parenthesis and invoking the Show surrounding parens event causes just the first line to be highlighted. Obviously, the second

[issue21694] IDLE - Test ParenMatch

2014-06-14 Thread Tal Einat
Tal Einat added the comment: I've opened a separate issue for the issue raised by Terry, #21756. Patch is included there. -- Added file: http://bugs.python.org/file35627/taleinat.20140614.IDLE_parenmatch_multiline_statement.patch ___ Python tracker

[issue21694] IDLE - Test ParenMatch

2014-06-14 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: Removed file: http://bugs.python.org/file35627/taleinat.20140614.IDLE_parenmatch_multiline_statement.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21694

[issue21686] IDLE - Test hyperparser

2014-06-14 Thread Tal Einat
Tal Einat added the comment: Here are details how to trigger all of the uncovered code lines and branches, listed by line. Uncovered lines: Line 159: This catches would-be identifiers (variable names) which are keywords or begin with a character that can't be first (e.g. a digit). We should

[issue21686] IDLE - Test hyperparser

2014-06-14 Thread Tal Einat
Tal Einat added the comment: Regarding lines 32 42, a test could also set editwin.num_context_lines to allow triggering with smaller code blocks. It's value needs to be a list of integers, the last of which is incredibly large, perhaps sys.maxint

[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-06-14 Thread Tal Einat
Tal Einat added the comment: With very minor changes (just use default=72 instead of or 72 and added a comment explaining why 72 is the default - see attached), I ran the entire test suite (which is a must according to the dev guide). On current default I'm getting consistent failures

[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-06-14 Thread Tal Einat
Tal Einat added the comment: Also, this seems like a small change. Should I mention it in Misc/NEWS? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20577

[issue21756] IDLE - ParenMatch fails to find closing paren of multi-line statements

2014-06-14 Thread Tal Einat
Tal Einat added the comment: Note that the patch changes the behavior only for ParenMatch.flash_paren_event(). Other uses, such as in CallTips, are not affected. The only possibly unwanted effect that I can think of is in an editor window, on a line missing a closing parenthesis, triggering

[issue21756] IDLE - ParenMatch fails to find closing paren of multi-line statements

2014-06-14 Thread Tal Einat
Tal Einat added the comment: Terry, I'm not sure what you mean but your last comment. HyperParser.get_surrounding_brackets() will return a previous opening bracket, even if no closing bracket is found for it. CallTips depends on that behavior to find the previous opening parenthesis even

[issue21686] IDLE - Test hyperparser

2014-06-13 Thread Tal Einat
Tal Einat added the comment: Which lines are not hit? -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21686 ___ ___ Python-bugs

[issue21694] IDLE - Test ParenMatch

2014-06-13 Thread Tal Einat
Tal Einat added the comment: I can take a look at get_surrounding_brackets() if you like, since I've worked with that code before. -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21694

[issue21696] Idle: test configuration files

2014-06-13 Thread Tal Einat
Tal Einat added the comment: I've done a thorough review of the tests. The overall structure and tests are fine, but I found quite a few issues that should be addressed. Saimadhav, considering these are some of the first tests you've written, please know that I am impressed! I have many

[issue11437] IDLE crash on startup with typo in config-keys.cfg

2014-06-12 Thread Tal Einat
Tal Einat added the comment: I don't think the patch should currently be committed. I agree with Terry: we should first fix the issue whereby the key config is read repeatedly. Given such a fix, the problematic known_invalid workaround in the patch would no longer be necessary. As a side

[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-06-11 Thread Tal Einat
Tal Einat added the comment: What do you mean with the comment regarding pep8? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20577

[issue3068] IDLE - Add an extension configuration dialog

2014-06-11 Thread Tal Einat
Tal Einat added the comment: Ned, many thanks for the review and detailed feedback! Here are responses to your comments 1. Thanks for the code suggestion regarding the menudefs! That's a good catch. I have an OSX box for such testing. 2. I'll check this out. Could you perhaps explain

[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-06-11 Thread Tal Einat
Tal Einat added the comment: I'll be damned. 72 it is, then. What about using the 'default' parameter for GetOption() instead of or 72? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20577

[issue694339] IDLE: Dedenting with Shift+Tab

2014-06-10 Thread Tal Einat
Tal Einat added the comment: Regarding Roger Serwy's comment, we could either: 1) normalize the event descriptions using MultiCall's _parse_sequence() and _triplet_to_sequence() functions 2) remove any Shift-Tab bindings from PrevWindow I suggest #2. Regarding the patch itself: 1

[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-06-10 Thread Tal Einat
Tal Einat added the comment: Thanks for reviewing this Terry! See two small comments in the review of your patch. Indeed, I would very much like for this to be my first commit. Thanks for the pointer WRT backporting to 2.7. Just to make sure, I should commit to 3.5 (default

[issue20177] Derby #8: Convert 28 sites to Argument Clinic across 2 files

2014-05-16 Thread Tal Einat
Tal Einat added the comment: Regarding the handling of time_t arguments which can be None, I agree that the second version (without custom convertors) is simpler and clearer while having no disadvantage that I can see. I'd like to review the rest of the patches, but you mention changes

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Tal Einat
Tal Einat added the comment: Changes LGTM. This module could certainly use some cleanup and updates. For example, last_changed should be a property and always accessed one way (instead of either .mtime() or .last_changed) and should be initialized to None instead of zero to avoid ambiguity

[issue13630] IDLE: Find(ed) text is not highlighted while dialog box is open

2014-05-09 Thread Tal Einat
Tal Einat added the comment: Indeed, redemo.py does include this feature. But it is a completely different application with a very specific goal - testing regular expressions. On the other hand, IDLE's search is meant to be used to find pieces of code in the editor, which is a significantly

[issue13630] IDLE: Find(ed) text is not highlighted while dialog box is open

2014-05-08 Thread Tal Einat
Tal Einat added the comment: Thanks for the kind words, Francisco! And also for taking the time to get SearchBar working on Python3 and giving it a try. I agree that SearchBar is a huge improvement over IDLE's simple find and replace dialogs. And by now every potential user is used

[issue13630] IDLE: Find(ed) text is not highlighted while dialog box is open

2014-03-21 Thread Tal Einat
Tal Einat added the comment: Im considering updating SearchBar and posting a patch. Marco, any chance you could detail the quirks and bugs you experienced when using SearchBar? -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http

[issue20440] Use Py_REPLACE/Py_XREPLACE macros

2014-02-25 Thread Tal Einat
Tal Einat added the comment: While we're bikeshedding, how about the more verbose PY_DECREF_AND_ASSIGN? That makes it clearer that an INCREF is not done. Regarding Kristján's suggestion of PY_ASSIGN and a complementary PY_STORE, IMO these names are too similar and the difference between them

[issue20440] Use Py_REPLACE/Py_XREPLACE macros

2014-02-25 Thread Tal Einat
Tal Einat added the comment: PY_ASSIGN_AND_DECREF could seem to imply that the assigned value is DECREF-ed. I think PY_DECREF_AND_ASSIGN makes it clearer that the original value is DECREF-ed. I like PY_ASSIGN_NULL_AND_DECREF, though for the same reason as above, I'd name

[issue6143] IDLE - an extension to clear the shell window

2014-02-23 Thread Tal Einat
Tal Einat added the comment: Terry, please do give Squeezer a try before making a decision! Squeezer may be slightly more complex than ClearWindow in concept and in code, but IMO it is simpler and more appropriate for use by a novice user. I'm attaching a screenshot to give a feeling of what

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-23 Thread Tal Einat
Tal Einat added the comment: See msg212020 for a Python-style explanation of the utility of the Squeezer extension. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1529353

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-23 Thread Tal Einat
Tal Einat added the comment: Added screenshot of what working with the IDLE shell with the Squeezer extension looks like (on Windows). Note that the second squeezed text is the very long Max recursion depth exception traceback, which I manually squeezed after it was printed. -- Added

[issue6143] IDLE - an extension to clear the shell window

2014-02-19 Thread Tal Einat
Tal Einat added the comment: Attaching a patch adding a ClearWindow extension for IDLE. I took some ideas from Roger's version in IdleX, but I wrote this version from scratch and it is significantly different in many aspects. This patch includes extensive tests with 98% coverage

[issue6143] IDLE - an extension to clear the shell window

2014-02-19 Thread Tal Einat
Tal Einat added the comment: Attached another patch which adds support for the Squeezer extension to ClearWindow. This is necessary in case the Squeezer extension is added to IDLE. This patch allows ClearWindow to properly remove squeezed text buttons created by Squeezer, and also reinsert

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-19 Thread Tal Einat
Tal Einat added the comment: Serhiy, which warnings? Some of the tests use Tk GUI elements, so they include requires('gui'). You need to run the tests with a proper environment so that these tests are run; otherwise you get a warning that the 'gui' resource in unavailable

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-19 Thread Tal Einat
Tal Einat added the comment: See related issue6143 IDLE - an extension to clear the shell window, where special support for Squeezer is required in that extension (patch included there). -- ___ Python tracker rep...@bugs.python.org http

[issue6143] IDLE - an extension to clear the shell window

2014-02-19 Thread Tal Einat
Tal Einat added the comment: Regarding the last patch, see issue1529353 which proposes adding the Squeezer IDLE extension (including patches). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6143

[issue6143] IDLE - an extension to clear the shell window

2014-02-16 Thread Tal Einat
Tal Einat added the comment: FYI, with some help from Roger answering various questions, I've cooked up a version of ClearWindow supporting the current version of IDLE. This includes integration with the Squeezer extension. I haven't tested it, however, nor written appropriate tests. I hope

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: +roger.serwy, terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1529353 ___ ___ Python

[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat
Tal Einat added the comment: Terry, if I wrote an appropriate patch, would it have a chance of being accepted? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6143

[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6143 ___ ___ Python-bugs-list mailing

[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat
Tal Einat added the comment: The relation to Squeezer is that both of these can be useful when you've had a large amount of output written in the IDLE shell. I prefer Squeezer as a solution for this issue, for two reasons: 1. Squeezer catches long outputs before they are ever written

[issue6143] IDLE - an extension to clear the shell window

2014-02-12 Thread Tal Einat
Tal Einat added the comment: Also, note that the new version of Squeezer allows squeezing tracebacks as well as normal output! It does not squeeze them automatically, though; the user must do so manually. -- ___ Python tracker rep

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Tal Einat
Tal Einat added the comment: Regarding the tooltip traceback, seems like that could be related. I added a tooltip to the squeezed text buttons, with no delay, so perhaps there's some kind of race condition? Could you try changing delay=0 in the code to delay=50 and see if the issue goes away

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-12 Thread Tal Einat
Tal Einat added the comment: Indeed, expanding very long texts still degrades the performance of IDLE. But the user has to explicitly expand the text (by double-clicking the button) and can easily squeeze the text again. As for your suggestion to show just the first several lines and a more

[issue20167] Exception on IDLE closing

2014-02-12 Thread Tal Einat
Tal Einat added the comment: Good catches, Terry and Serhiy! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20167 ___ ___ Python-bugs-list

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-11 Thread Tal Einat
Tal Einat added the comment: Here's a completely re-written patch! The patch is against current 3.3 (changeset 360976a6d8b9), since that's what Terry requested recently on issue3068. It also applies cleanly to the current default branch (changeset 360976a6d8b9). This patch has cleaner

[issue6143] IDLE - an extension to clear the shell window

2014-02-11 Thread Tal Einat
Tal Einat added the comment: Removing text before iomark can be done by using the underlying Text widget directly. See how the Squeezer extension does this in issue1529353. This should simplify the implementation significantly. I also took a look at the version of the extension in IdleX. I'm

[issue6143] IDLE - an extension to clear the shell window

2014-02-11 Thread Tal Einat
Tal Einat added the comment: Roger, thanks for the quick response! I'll try to get to working on this in the coming days. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6143

[issue3068] IDLE - Add an extension configuration dialog

2014-02-09 Thread Tal Einat
Tal Einat added the comment: It's an old patch and it may not be in a properly recognized format. I'll create a new patch soon. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3068

[issue3068] IDLE - Add an extension configuration dialog

2014-02-09 Thread Tal Einat
Tal Einat added the comment: I'm glad that adding features to IDLE is being considered! However, I really think that new features should be chosen with extreme care. Adding advanced features aimed mostly at power users should be avoided unless really necessary, IMO. The reason I'm pushing

[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-02-09 Thread Tal Einat
New submission from Tal Einat: Following up issue3068, this is a separate patch which moves the paragraph reformat width setting from the general tab in IDLE's config dialog to the relevant place in the extensions configuration. -- components: IDLE files: taleinat.20140209

[issue3068] IDLE - Add an extension configuration dialog

2014-02-09 Thread Tal Einat
Tal Einat added the comment: Here's an updated patch. As requested, the patch is against the current 3.3 branch and applies cleanly to default. I tested with both Python 3.3.4 RC1 and 3.4.0 beta 3, while overriding their idlelib with the one from the repo with these changes. I also removed

[issue3068] IDLE - Add an extension configuration dialog

2014-02-05 Thread Tal Einat
Tal Einat added the comment: (This is a bit long; there's a TL;DR at the end.) You'd be surprised how many of IDLE's features are implemented as extensions. These are simply included in idlelib, enabled by default and configured with reasonable values. Take a look at Lib/idlelib/config

[issue1529353] Squeezer - squeeze large output in the interpreter

2014-02-05 Thread Tal Einat
Tal Einat added the comment: Ping? Can this please go in? It's such a great improvement to user experience! I've seen too many novice users print a ton of output by accident and have IDLE hang as a result, losing their interactive session. This simple extension avoid those issues completely

[issue20167] Exception on IDLE closing

2014-02-05 Thread Tal Einat
Tal Einat added the comment: This is caused by MultiCall's _ComplexBinder.__del__() being called during app shutdown. _ComplexBinder.__del__() unbinds a bunch of event handlers from the widget to which it is attached. It seems that there's some edge case here where the underlying Tk widget

[issue20167] Exception on IDLE closing

2014-02-05 Thread Tal Einat
Tal Einat added the comment: I put the try/except outside of the loop on purpose. If calling the widget's unbind() method fails once, it will fail forever afterwards. If you prefer a different spelling, move the try/except into the loop, and break out of the loop in case of an exception

[issue20167] Exception on IDLE closing

2014-02-05 Thread Tal Einat
Tal Einat added the comment: Attaching second patch, to replace the first. As suggested by Serhiy, I moved the try/except block into the loop. I also added a comment explaining the try/except block and referencing this issue. -- Added file: http://bugs.python.org/file33926

[issue20167] Exception on IDLE closing

2014-02-05 Thread Tal Einat
Tal Einat added the comment: Both previous patches caused an import error. Here's a new patch with that fixed, and actually tested to fix the bug. -- Added file: http://bugs.python.org/file33927/taleinat_idle_closing_exception_3.patch ___ Python

[issue5680] Command-line arguments when running in IDLE

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5680 ___ ___ Python-bugs-list mailing

[issue1528593] Printing: No print dialog or page setup

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1528593 ___ ___ Python-bugs-list

[issue1253] IDLE - Percolator overhaul

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1253 ___ ___ Python-bugs-list mailing

[issue4832] IDLE does not supply a default ext of .py on Windows or OS X for new file saves

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4832 ___ ___ Python-bugs-list mailing

[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2704 ___ ___ Python-bugs-list mailing

[issue1253] IDLE - Percolator overhaul

2014-02-04 Thread Tal Einat
Tal Einat added the comment: This should be closed as wont fix. -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1253

[issue6143] IDLE - an extension to clear the shell window

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6143 ___ ___ Python-bugs-list mailing

[issue1442493] IDLE shell window gets very slow when displaying long lines

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1442493 ___ ___ Python-bugs-list

[issue1612262] Class Browser doesn't show internal classes

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1612262 ___ ___ Python-bugs-list

[issue9262] IDLE: Use tabbed shell and edit windows

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9262 ___ ___ Python-bugs-list mailing

[issue3068] IDLE - Add an extension configuration dialog

2014-02-04 Thread Tal Einat
Tal Einat added the comment: Is there any chance this patch could get some love? I've stopped using IDLE a long time ago, but this patch is a great improvement! -- versions: +Python 3.5 -Python 3.2 ___ Python tracker rep...@bugs.python.org http

[issue10079] idlelib for Python 3 with Guilherme Polo GSoC enhancements

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10079 ___ ___ Python-bugs-list mailing

[issue12411] cgi.parse_multipart is broken on 3.x

2014-02-04 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12411 ___ ___ Python-bugs-list mailing

[issue6858] This is a python file, apply syntax highlighting

2014-02-04 Thread Tal Einat
Tal Einat added the comment: Roger's patch LGTM, and should be considered a bug-fix. I will note, however, that this doesn't address the original issue: It still does not supply an easily discoverable method of toggling highlighting. Having a keyboard shortcut documented in the help file

[issue3068] IDLE - Add an extension configuration dialog

2014-02-04 Thread Tal Einat
Tal Einat added the comment: As the title suggests, this patch adds a second configuration dialog, used to configure extensions. This is useful because many extensions have parameters, but setting them can only be done by editing a file. Also, the documentation for such parameters is hard

[issue2213] build_tkinter.py does not handle paths with spaces

2014-02-03 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2213 ___ ___ Python-bugs-list mailing

[issue1524639] Fix Tkinter Tcl-commands memory-leaks

2014-02-03 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: -taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1524639 ___ ___ Python-bugs-list

[issue20349] Argument Clinic: error on __new__ or __init__ with no arguments

2014-01-31 Thread Tal Einat
Tal Einat added the comment: This has indeed been fixed by the change you mentioned. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20349

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-27 Thread Tal Einat
Tal Einat added the comment: Attached is a complete AC conversion of itertools. This is a large conversion, so I was extra careful. I even went over the entire diff manually to check for any errors. Compilation runs without warnings and the entire test suite passes. Notes: * I didn't convert

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-27 Thread Tal Einat
Tal Einat added the comment: And at that, I've finished the conversion of this entire Derby group! Woohoo! (except for itertools.repeat which is pending discussion) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20180

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-26 Thread Tal Einat
Tal Einat added the comment: Using the latest clinic.py from default branch, everything in itertools works like a charm :) -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20385

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: I've found two bugs: 1) In the type check, a '' needs to be added before the type name. 2) Setting template_dict['self_type_object'] fails for module functions -- ___ Python tracker rep...@bugs.python.org http

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: Also, I believe the the type of the first argument passed to a method is a pointer to the typedef object, so a '*' needs to be added after the typedef name wherever it is used in such functions. -- ___ Python tracker

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: My last comment was wrong. There is a bug regarding the first argument to new methods; It should just remain a PyTypeObject*. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20385

[issue20325] Argument Clinic: self converters are not preserved when cloning functions

2014-01-25 Thread Tal Einat
Tal Einat added the comment: You're right, this issue does indeed seem to have been resolved since I created this issue. I just checked this on Objects/bytesobject.c with the latest version and get the desired output. So you've done right to close this issue. I'd like to note that I most

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: I'm still seeing the first argument to a __new__ function as groupbyobject * instead of PyTypeObject *. This causes the following error (for example): ./Modules/itertoolsmodule.c:112:34: error: no member named 'tp_alloc' in 'groupbyobject' gbo = (groupbyobject

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: To clarify my previous comment, I was referring to the first argument passed to the generated 'impl' function. Context: I'm attempting to convert 'itertools.groupby' in Modules/itertoolsmodule.c. -- ___ Python tracker

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: Also, I'm seeing this in the generated code for __new__ methods: if (({self_name} == {self_type_object}) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20385

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-25 Thread Tal Einat
Tal Einat added the comment: To make reproducing these bugs easier, I'm attaching my partially converted version of Modules/itertoolsmodules.c, which has the buggy generated code inside. Partially converted means that I've only converted some of the functions requiring conversion. This file

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-24 Thread Tal Einat
New submission from Tal Einat: To quote issue20294 where Larry Hastings added AC support for __new__ and __init__: * __init__ and __new__ always take kwargs. * if the function signature doesn't accept keyword arguments, it calls _PyArg_NoKeywords(). However, due to issue1486663, many

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-24 Thread Tal Einat
Tal Einat added the comment: In general, that sounds like a reasonable suggestion to me. A quick search shows that most classes that call _PyArg_NoKeywords check the type first. I think we should strive for uniformity in this respect, so I'm +1 for your suggestion. I do see some classes

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-24 Thread Tal Einat
Tal Einat added the comment: Great. Most of the classes in itertools could use this. BTW, you'll need to supply a way to supply the C name of the type, to use in the type check. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue20385] Argument Clinic: Support for __new__ not checking _PyArg_NoKeywords for sub-classes

2014-01-24 Thread Tal Einat
Tal Einat added the comment: +1 for that as well, I've written quite a few self converters for that reason. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20385

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-23 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___ ___ Python-bugs-list mailing

[issue20341] Argument Clinic: add nullable ints

2014-01-22 Thread Tal Einat
Tal Einat added the comment: You look very handsome today Larry :) Regardless, I do think this is a good idea. I've converted several functions that have -1 as a default value for ints where they ideally should have None. Having None as the default will be much clearer and less error prone

[issue20341] Argument Clinic: add nullable ints

2014-01-22 Thread Tal Einat
Tal Einat added the comment: My only comment from reviewing the patch is that you seem to have used NULLABLE_PY_SSIZE_T_INITIALIZE by accident one time in int_converter (in clinic.py). Other than that, as you already know, make sure to return 1 in both converters in the if (arg == Py_None

[issue20341] Argument Clinic: add nullable ints

2014-01-22 Thread Tal Einat
Tal Einat added the comment: Found two bugs in the draft patch in Objects/longobject.c: 1) In _PyLong_NullableIntConverter, there is no index variable, so the Py_DECREF and Py_XDECREF need to be removed from the end of the function. 2) In _PyLong_NullablePy_ssize_tConverter, the index

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-22 Thread Tal Einat
Tal Einat added the comment: Attached nearly complete conversion of Modules/_collectionsmodule.c. I've converted all functions using PyArg_* functions, including __new__ methods, but not deque.__init__. I'm attaching a separate patch for deque.__init__. -- Added file: http

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-22 Thread Tal Einat
Tal Einat added the comment: Attached a patch converting deque.__init__ in Modules/_collectionsmodule.c, which completes the conversion of this file. This patch depends Larry's first patch in issue20341 (Argument Clinic: add nullable ints). This functionality is used to simplify the existing

[issue20341] Argument Clinic: add nullable ints

2014-01-22 Thread Tal Einat
Tal Einat added the comment: Another bug in the patch: In int_converter.__init__ in clinic.py, the patch adds: if not isinstance(self.default, int): fail(Illegal default value for int_converter) This fails if no default is specified, e.g. for positional only argument. The condition

[issue20346] Argument Clinic: missing entry in table mapping legacy convertors to real AC converters

2014-01-22 Thread Tal Einat
Changes by Tal Einat talei...@gmail.com: -- assignee: - docs@python components: +Build, Demos and Tools, Documentation nosy: +docs@python type: - enhancement versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue20346] Argument Clinic: missing entry in table mapping legacy convertors to real AC converters

2014-01-22 Thread Tal Einat
New submission from Tal Einat: There is no entry for 'l', which maps to 'long' according to 'long_converter' in clinic.py. Patch attached for Doc/howto/clinic.rst. -- files: missing_long_legacy_converter.clinic.rst.patch keywords: patch messages: 208818 nosy: larry, taleinat priority

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-22 Thread Tal Einat
Tal Einat added the comment: Attached is a complete conversion of Modules/_randommodule.c. Three _random.Random methods were converted: seed, getrandbits and __new__. There's was an problem converting _random.Random.__new__. I overcame it cleanly and think this patch is good. Details about

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2014-01-22 Thread Tal Einat
Tal Einat added the comment: Attached complete conversion of Modules/xxlimited.c, Modules/xxmodule.c and Modules/xxsubtype.c. There are no tests for these and the code is not used by anything AFAIK, so I was extra careful and went over the diffs manually once everything was done

[issue20349] Argument Clinic: error on __new__ or __init__ with no arguments

2014-01-22 Thread Tal Einat
New submission from Tal Einat: This is caused by the code fields = list(parser_body_fields) under if new_or_init: in CLanguage.output_templates(). 'parser_body_fields' is initialized to None and may not be set before the above mentioned code. Attached is a patch which replaces the line

<    8   9   10   11   12   13   14   15   >