Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

#21686: IDLE - Test hyperparser

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 8 months ago by saimadhavheblikar
Modified:
5 years, 8 months ago
Reviewers:
taleinat, tjreedy
CC:
terry.reedy, taleinat, jesstess, devnull_psf.upfronthosting.co.za, sahutd
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 6

Patch Set 3 #

Patch Set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/idlelib/HyperParser.py View 1 2 3 5 chunks +10 lines, -4 lines 0 comments Download
Lib/idlelib/idle_test/test_hyperparser.py View 1 2 3 1 chunk +191 lines, -0 lines 0 comments Download

Messages

Total messages: 3
sahutd
http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/HyperParser.py File Lib/idlelib/HyperParser.py (right): http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/HyperParser.py#newcode97 Lib/idlelib/HyperParser.py:97: self.rawtext[self.bracketing[self.indexbracket][0]] in ('"', "'") Is there some way to ...
5 years, 8 months ago #1
taleinat_gmail.com
http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/HyperParser.py File Lib/idlelib/HyperParser.py (right): http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/HyperParser.py#newcode97 Lib/idlelib/HyperParser.py:97: self.rawtext[self.bracketing[self.indexbracket][0]] in ('"', "'") On 2014/06/14 16:38:34, sahutd wrote: ...
5 years, 8 months ago #2
terry.reedy
5 years, 8 months ago #3
http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/idle_test/test_hyp...
File Lib/idlelib/idle_test/test_hyperparser.py (right):

http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/idle_test/test_hyp...
Lib/idlelib/idle_test/test_hyperparser.py:14: # existing code from EditorWindow
In Python, we can copy the object instead of the code, so changes to
EditorWindow propagate here.

from EditorWindow import EditorWindow
...
_build_char_in_string_func = EditorWindow._build_char_in_string_func

is_char_in_string = EW.is_char_in_string

Some considerations when doing this.
0. 'self' refers to the dummy instance, as desired.
1. Does the extra import have negative side-effects?
(I don't believe so here.)
2. The globals for the function will remain the original module. Good or bad?
(Irrelevant with no global references. Typically good otherwise.
3. For backport, must add '.im_func' to reference:
meth = mod.meth.im_func

http://bugs.python.org/review/21686/diff/12161/Lib/idlelib/idle_test/test_hyp...
Lib/idlelib/idle_test/test_hyperparser.py:84: self.editwin.num_context_lines =
50, 500, 1000
The dummy editwin did not have this attribute, The real EditorWindow does, with
constant values 50, 500, 5000000. I would just set this attribute in the dummy
definition above and leave it.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+