Show More
@@ -157,8 +157,8 b' except ImportError:' | |||||
157 | #----------------------------------------------------------------------------- |
|
157 | #----------------------------------------------------------------------------- | |
158 |
|
158 | |||
159 | # ranges where we have most of the valid unicode names. We could be more finer |
|
159 | # ranges where we have most of the valid unicode names. We could be more finer | |
160 | # grained but is it worth it for performace While unicode have character in the |
|
160 | # grained but is it worth it for performance While unicode have character in the | |
161 | # rage 0, 0x110000, we seem to have name for about 10% of those. (131808 as I |
|
161 | # range 0, 0x110000, we seem to have name for about 10% of those. (131808 as I | |
162 | # write this). With below range we cover them all, with a density of ~67% |
|
162 | # write this). With below range we cover them all, with a density of ~67% | |
163 | # biggest next gap we consider only adds up about 1% density and there are 600 |
|
163 | # biggest next gap we consider only adds up about 1% density and there are 600 | |
164 | # gaps that would need hard coding. |
|
164 | # gaps that would need hard coding. | |
@@ -2062,7 +2062,7 b' class IPCompleter(Completer):' | |||||
2062 | A tuple of N elements which are (likely): |
|
2062 | A tuple of N elements which are (likely): | |
2063 | matched_text: ? the text that the complete matched |
|
2063 | matched_text: ? the text that the complete matched | |
2064 | matches: list of completions ? |
|
2064 | matches: list of completions ? | |
2065 |
matches_origin: ? list same leng |
|
2065 | matches_origin: ? list same length as matches, and where each completion came from | |
2066 | jedi_matches: list of Jedi matches, have it's own structure. |
|
2066 | jedi_matches: list of Jedi matches, have it's own structure. | |
2067 | """ |
|
2067 | """ | |
2068 |
|
2068 | |||
@@ -2179,7 +2179,7 b' class IPCompleter(Completer):' | |||||
2179 | # TODO: self.unicode_names is here a list we traverse each time with ~100k elements. |
|
2179 | # TODO: self.unicode_names is here a list we traverse each time with ~100k elements. | |
2180 | # We could do a faster match using a Trie. |
|
2180 | # We could do a faster match using a Trie. | |
2181 |
|
2181 | |||
2182 | # Using pygtrie the follwing seem to work: |
|
2182 | # Using pygtrie the following seem to work: | |
2183 |
|
2183 | |||
2184 | # s = PrefixSet() |
|
2184 | # s = PrefixSet() | |
2185 |
|
2185 |
@@ -69,8 +69,8 b' or configure it in your ``.pdbrc``' | |||||
69 |
|
69 | |||
70 |
|
70 | |||
71 |
|
71 | |||
72 |
Licen |
|
72 | License | |
73 |
------- |
|
73 | ------- | |
74 |
|
74 | |||
75 | Modified from the standard pdb.Pdb class to avoid including readline, so that |
|
75 | Modified from the standard pdb.Pdb class to avoid including readline, so that | |
76 | the command line completion of other programs which include this isn't |
|
76 | the command line completion of other programs which include this isn't | |
@@ -427,7 +427,7 b' class Pdb(OldPdb):' | |||||
427 | # The f_locals dictionary is updated from the actual frame |
|
427 | # The f_locals dictionary is updated from the actual frame | |
428 | # locals whenever the .f_locals accessor is called, so we |
|
428 | # locals whenever the .f_locals accessor is called, so we | |
429 | # avoid calling it here to preserve self.curframe_locals. |
|
429 | # avoid calling it here to preserve self.curframe_locals. | |
430 | # Futhermore, there is no good reason to hide the current frame. |
|
430 | # Furthermore, there is no good reason to hide the current frame. | |
431 | ip_hide = [self._hidden_predicate(s[0]) for s in stack] |
|
431 | ip_hide = [self._hidden_predicate(s[0]) for s in stack] | |
432 | ip_start = [i for i, s in enumerate(ip_hide) if s == "__ipython_bottom__"] |
|
432 | ip_start = [i for i, s in enumerate(ip_hide) if s == "__ipython_bottom__"] | |
433 | if ip_start and self._predicates["ipython_internal"]: |
|
433 | if ip_start and self._predicates["ipython_internal"]: | |
@@ -520,8 +520,8 b' class Pdb(OldPdb):' | |||||
520 |
|
520 | |||
521 | def _get_frame_locals(self, frame): |
|
521 | def _get_frame_locals(self, frame): | |
522 | """ " |
|
522 | """ " | |
523 | Acessing f_local of current frame reset the namespace, so we want to avoid |
|
523 | Accessing f_local of current frame reset the namespace, so we want to avoid | |
524 |
that or the following can happen |
|
524 | that or the following can happen | |
525 |
|
525 | |||
526 | ipdb> foo |
|
526 | ipdb> foo | |
527 | "old" |
|
527 | "old" | |
@@ -993,7 +993,7 b' class Pdb(OldPdb):' | |||||
993 | if counter >= count: |
|
993 | if counter >= count: | |
994 | break |
|
994 | break | |
995 | else: |
|
995 | else: | |
996 | # if no break occured. |
|
996 | # if no break occurred. | |
997 | self.error( |
|
997 | self.error( | |
998 | "all frames above hidden, use `skip_hidden False` to get get into those." |
|
998 | "all frames above hidden, use `skip_hidden False` to get get into those." | |
999 | ) |
|
999 | ) | |
@@ -1038,7 +1038,7 b' class Pdb(OldPdb):' | |||||
1038 | break |
|
1038 | break | |
1039 | else: |
|
1039 | else: | |
1040 | self.error( |
|
1040 | self.error( | |
1041 |
"all frames bel |
|
1041 | "all frames below hidden, use `skip_hidden False` to get get into those." | |
1042 | ) |
|
1042 | ) | |
1043 | return |
|
1043 | return | |
1044 |
|
1044 |
@@ -49,7 +49,7 b' def test_alias_args_commented():' | |||||
49 | _ip.run_cell('commetarg') |
|
49 | _ip.run_cell('commetarg') | |
50 |
|
50 | |||
51 | # strip() is for pytest compat; testing via iptest patch IPython shell |
|
51 | # strip() is for pytest compat; testing via iptest patch IPython shell | |
52 | # in testin.globalipapp and replace the system call which messed up the |
|
52 | # in testing.globalipapp and replace the system call which messed up the | |
53 | # \r\n |
|
53 | # \r\n | |
54 | assert cap.stdout.strip() == 'this is %s a commented out arg' |
|
54 | assert cap.stdout.strip() == 'this is %s a commented out arg' | |
55 |
|
55 |
@@ -86,7 +86,7 b' def test_unicode_range():' | |||||
86 | size, start, stop, prct = recompute_unicode_ranges() |
|
86 | size, start, stop, prct = recompute_unicode_ranges() | |
87 | message = f"""_UNICODE_RANGES likely wrong and need updating. This is |
|
87 | message = f"""_UNICODE_RANGES likely wrong and need updating. This is | |
88 | likely due to a new release of Python. We've find that the biggest gap |
|
88 | likely due to a new release of Python. We've find that the biggest gap | |
89 | in unicode characters has reduces in size to be {size} charaters |
|
89 | in unicode characters has reduces in size to be {size} characters | |
90 | ({prct}), from {start}, to {stop}. In completer.py likely update to |
|
90 | ({prct}), from {start}, to {stop}. In completer.py likely update to | |
91 |
|
91 | |||
92 | _UNICODE_RANGES = [(32, {start}), ({stop}, 0xe01f0)] |
|
92 | _UNICODE_RANGES = [(32, {start}), ({stop}, 0xe01f0)] | |
@@ -302,7 +302,7 b' class TestCompleter(unittest.TestCase):' | |||||
302 | def test_back_latex_completion(self): |
|
302 | def test_back_latex_completion(self): | |
303 | ip = get_ipython() |
|
303 | ip = get_ipython() | |
304 |
|
304 | |||
305 |
# do not return more than 1 matches f |
|
305 | # do not return more than 1 matches for \beta, only the latex one. | |
306 | name, matches = ip.complete("\\β") |
|
306 | name, matches = ip.complete("\\β") | |
307 | nt.assert_equal(matches, ['\\beta']) |
|
307 | nt.assert_equal(matches, ['\\beta']) | |
308 |
|
308 |
@@ -125,7 +125,7 b' def test_image_filename_defaults():' | |||||
125 | embed=True) |
|
125 | embed=True) | |
126 | nt.assert_raises(ValueError, display.Image) |
|
126 | nt.assert_raises(ValueError, display.Image) | |
127 | nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True) |
|
127 | nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True) | |
128 |
# check both |
|
128 | # check both paths to allow packages to test at build and install time | |
129 | imgfile = os.path.join(tpath, 'core/tests/2x2.png') |
|
129 | imgfile = os.path.join(tpath, 'core/tests/2x2.png') | |
130 | img = display.Image(filename=imgfile) |
|
130 | img = display.Image(filename=imgfile) | |
131 | nt.assert_equal('png', img.format) |
|
131 | nt.assert_equal('png', img.format) |
@@ -300,7 +300,7 b' def test_check_complete_II():' | |||||
300 | def test_check_complete_invalidates_sunken_brackets(): |
|
300 | def test_check_complete_invalidates_sunken_brackets(): | |
301 | """ |
|
301 | """ | |
302 | Test that a single line with more closing brackets than the opening ones is |
|
302 | Test that a single line with more closing brackets than the opening ones is | |
303 |
interpret |
|
303 | interpreted as invalid | |
304 | """ |
|
304 | """ | |
305 | cc = ipt2.TransformerManager().check_complete |
|
305 | cc = ipt2.TransformerManager().check_complete | |
306 | nt.assert_equal(cc(")"), ("invalid", None)) |
|
306 | nt.assert_equal(cc(")"), ("invalid", None)) |
@@ -557,7 +557,7 b' def test_multiprocessing_run():' | |||||
557 | """Set we can run mutiprocesgin without messing up up main namespace |
|
557 | """Set we can run mutiprocesgin without messing up up main namespace | |
558 |
|
558 | |||
559 | Note that import `nose.tools as nt` mdify the value s |
|
559 | Note that import `nose.tools as nt` mdify the value s | |
560 |
sys.module['__mp_main__'] so we |
|
560 | sys.module['__mp_main__'] so we need to temporarily set it to None to test | |
561 | the issue. |
|
561 | the issue. | |
562 | """ |
|
562 | """ | |
563 | with TemporaryDirectory() as td: |
|
563 | with TemporaryDirectory() as td: |
@@ -303,7 +303,7 b' class TestAutoreload(Fixture):' | |||||
303 | self.shell.run_code("t = Test()") |
|
303 | self.shell.run_code("t = Test()") | |
304 | # test global built-in var now exists |
|
304 | # test global built-in var now exists | |
305 | self.shell.run_code("number") |
|
305 | self.shell.run_code("number") | |
306 | # test the enumerations gets loaded succesfully |
|
306 | # test the enumerations gets loaded successfully | |
307 | self.shell.run_code("TestEnum.A") |
|
307 | self.shell.run_code("TestEnum.A") | |
308 |
|
308 | |||
309 | # ----------- TEST NEW OBJ CAN BE CHANGED -------------------- |
|
309 | # ----------- TEST NEW OBJ CAN BE CHANGED -------------------- |
@@ -198,7 +198,7 b' def import_pyqt4(version=2):' | |||||
198 | Which QString/QVariant API to use. Set to None to use the system |
|
198 | Which QString/QVariant API to use. Set to None to use the system | |
199 | default |
|
199 | default | |
200 |
|
200 | |||
201 |
ImportErrors ra |
|
201 | ImportErrors raised within this function are non-recoverable | |
202 | """ |
|
202 | """ | |
203 | # The new-style string API (version=2) automatically |
|
203 | # The new-style string API (version=2) automatically | |
204 | # converts QStrings to Unicode Python strings. Also, automatically unpacks |
|
204 | # converts QStrings to Unicode Python strings. Also, automatically unpacks | |
@@ -229,7 +229,7 b' def import_pyqt5():' | |||||
229 | """ |
|
229 | """ | |
230 | Import PyQt5 |
|
230 | Import PyQt5 | |
231 |
|
231 | |||
232 |
ImportErrors ra |
|
232 | ImportErrors raised within this function are non-recoverable | |
233 | """ |
|
233 | """ | |
234 |
|
234 | |||
235 | from PyQt5 import QtCore, QtSvg, QtWidgets, QtGui |
|
235 | from PyQt5 import QtCore, QtSvg, QtWidgets, QtGui | |
@@ -251,7 +251,7 b' def import_pyqt6():' | |||||
251 | """ |
|
251 | """ | |
252 | Import PyQt6 |
|
252 | Import PyQt6 | |
253 |
|
253 | |||
254 |
ImportErrors ra |
|
254 | ImportErrors raised within this function are non-recoverable | |
255 | """ |
|
255 | """ | |
256 |
|
256 | |||
257 | from PyQt6 import QtCore, QtSvg, QtWidgets, QtGui |
|
257 | from PyQt6 import QtCore, QtSvg, QtWidgets, QtGui |
@@ -135,7 +135,7 b' class BackgroundJobManager(object):' | |||||
135 |
|
135 | |||
136 | job_manager.new(myfunc, x, y, kw=dict(z=1)) |
|
136 | job_manager.new(myfunc, x, y, kw=dict(z=1)) | |
137 |
|
137 | |||
138 |
The reason for this as |
|
138 | The reason for this asymmetry is that the new() method needs to | |
139 | maintain access to its own keywords, and this prevents name collisions |
|
139 | maintain access to its own keywords, and this prevents name collisions | |
140 | between arguments to new() and arguments to your own functions. |
|
140 | between arguments to new() and arguments to your own functions. | |
141 |
|
141 |
@@ -532,7 +532,7 b' class Demo(object):' | |||||
532 | elif token[0] == Token.Comment.Single: |
|
532 | elif token[0] == Token.Comment.Single: | |
533 | toks.append((Token.Comment.Single, token[1][0])) |
|
533 | toks.append((Token.Comment.Single, token[1][0])) | |
534 | # parse comment content by rst lexer |
|
534 | # parse comment content by rst lexer | |
535 |
# remove the extra |
|
535 | # remove the extra newline added by rst lexer | |
536 | toks += list(pygments.lex(token[1][1:], self.rst_lexer))[:-1] |
|
536 | toks += list(pygments.lex(token[1][1:], self.rst_lexer))[:-1] | |
537 | else: |
|
537 | else: | |
538 | toks.append(token) |
|
538 | toks.append(token) |
@@ -156,7 +156,7 b' def make_label_dec(label, ds=None):' | |||||
156 |
|
156 | |||
157 | def skip_iptest_but_not_pytest(f): |
|
157 | def skip_iptest_but_not_pytest(f): | |
158 | """ |
|
158 | """ | |
159 |
Warni |
|
159 | Warning this will make the test invisible to iptest. | |
160 | """ |
|
160 | """ | |
161 | import os |
|
161 | import os | |
162 |
|
162 |
@@ -209,7 +209,7 b' def get_home_dir(require_writable=False) -> str:' | |||||
209 | pass |
|
209 | pass | |
210 |
|
210 | |||
211 | if (not require_writable) or _writable_dir(homedir): |
|
211 | if (not require_writable) or _writable_dir(homedir): | |
212 |
assert isinstance(homedir, str), "Homedir shou |
|
212 | assert isinstance(homedir, str), "Homedir should be unicode not bytes" | |
213 | return homedir |
|
213 | return homedir | |
214 | else: |
|
214 | else: | |
215 | raise HomeDirError('%s is not a writable dir, ' |
|
215 | raise HomeDirError('%s is not a writable dir, ' |
@@ -13,7 +13,7 b" pygtk.require('2.0')" | |||||
13 | import gtk |
|
13 | import gtk | |
14 |
|
14 | |||
15 |
|
15 | |||
16 |
def hello_world(wi |
|
16 | def hello_world(widget, data=None): | |
17 | print("Hello World") |
|
17 | print("Hello World") | |
18 |
|
18 | |||
19 | def delete_event(widget, event, data=None): |
|
19 | def delete_event(widget, event, data=None): |
@@ -11,7 +11,7 b' In [2]: %run gui-gtk3.py' | |||||
11 | from gi.repository import Gtk |
|
11 | from gi.repository import Gtk | |
12 |
|
12 | |||
13 |
|
13 | |||
14 |
def hello_world(wi |
|
14 | def hello_world(widget, data=None): | |
15 | print("Hello World") |
|
15 | print("Hello World") | |
16 |
|
16 | |||
17 | def delete_event(widget, event, data=None): |
|
17 | def delete_event(widget, event, data=None): |
@@ -14,7 +14,7 b' gi.require_version("Gtk", "4.0")' | |||||
14 | from gi.repository import Gtk, GLib # noqa |
|
14 | from gi.repository import Gtk, GLib # noqa | |
15 |
|
15 | |||
16 |
|
16 | |||
17 |
def hello_world(wi |
|
17 | def hello_world(widget, data=None): | |
18 | print("Hello World") |
|
18 | print("Hello World") | |
19 |
|
19 | |||
20 |
|
20 |
@@ -62,7 +62,7 b' maybe_edit(){' | |||||
62 |
|
62 | |||
63 |
|
63 | |||
64 | echo |
|
64 | echo | |
65 |
if ask_section "Updating what's new with information |
|
65 | if ask_section "Updating what's new with information from docs/source/whatsnew/pr" | |
66 | then |
|
66 | then | |
67 | python tools/update_whatsnew.py |
|
67 | python tools/update_whatsnew.py | |
68 |
|
68 | |||
@@ -100,7 +100,7 b' then' | |||||
100 | git checkout $PREV_RELEASE |
|
100 | git checkout $PREV_RELEASE | |
101 | echo $BLUE"Saving API to file $PREV_RELEASE"$NOR |
|
101 | echo $BLUE"Saving API to file $PREV_RELEASE"$NOR | |
102 | frappuccino IPython --save IPython-$PREV_RELEASE.json |
|
102 | frappuccino IPython --save IPython-$PREV_RELEASE.json | |
103 |
echo $BLUE"com |
|
103 | echo $BLUE"coming back to $BRANCH"$NOR | |
104 | git checkout $BRANCH |
|
104 | git checkout $BRANCH | |
105 | echo $BLUE"comparing ..."$NOR |
|
105 | echo $BLUE"comparing ..."$NOR | |
106 | frappuccino IPython --compare IPython-$PREV_RELEASE.json |
|
106 | frappuccino IPython --compare IPython-$PREV_RELEASE.json |
@@ -9,7 +9,7 b' usage:' | |||||
9 |
|
9 | |||
10 | The process of creating an sdist can be non-reproducible: |
|
10 | The process of creating an sdist can be non-reproducible: | |
11 | - directory created during the process get a mtime of the creation date; |
|
11 | - directory created during the process get a mtime of the creation date; | |
12 |
- gziping files embed the timestamp of |
|
12 | - gziping files embed the timestamp of zip creation. | |
13 |
|
13 | |||
14 | This will untar-retar; ensuring that all mtime > SOURCE_DATE_EPOCH will be set |
|
14 | This will untar-retar; ensuring that all mtime > SOURCE_DATE_EPOCH will be set | |
15 | equal to SOURCE_DATE_EPOCH. |
|
15 | equal to SOURCE_DATE_EPOCH. |
@@ -8144,7 +8144,7 b'' | |||||
8144 | " </thead>\n", |
|
8144 | " </thead>\n", | |
8145 | " <tbody>\n", |
|
8145 | " <tbody>\n", | |
8146 | " <tr>\n", |
|
8146 | " <tr>\n", | |
8147 | " <td>but thi</td>\n", |
|
8147 | " <td>but this</td>\n", | |
8148 | " <td>is the </td>\n", |
|
8148 | " <td>is the </td>\n", | |
8149 | " </tr>\n", |
|
8149 | " </tr>\n", | |
8150 | " <tr>\n", |
|
8150 | " <tr>\n", |
General Comments 0
You need to be logged in to leave comments.
Login now