]> git.madduck.net Git - etc/vim.git/blob - tests/data/simple_cases/comments3.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Upgrade to Furo 2023.9.10 to fix docs build (#3873)
[etc/vim.git] / tests / data / simple_cases / comments3.py
1 # The percent-percent comments are Spyder IDE cells.
2
3
4 # %%
5 def func():
6     x = """
7     a really long string
8     """
9     lcomp3 = [
10         # This one is actually too long to fit in a single line.
11         element.split("\n", 1)[0]
12         # yup
13         for element in collection.select_elements()
14         # right
15         if element is not None
16     ]
17     # Capture each of the exceptions in the MultiError along with each of their causes and contexts
18     if isinstance(exc_value, MultiError):
19         embedded = []
20         for exc in exc_value.exceptions:
21             if exc not in _seen:
22                 embedded.append(
23                     # This should be left alone (before)
24                     traceback.TracebackException.from_exception(
25                         exc,
26                         limit=limit,
27                         lookup_lines=lookup_lines,
28                         capture_locals=capture_locals,
29                         # copy the set of _seen exceptions so that duplicates
30                         # shared between sub-exceptions are not omitted
31                         _seen=set(_seen),
32                     )
33                     # This should be left alone (after)
34                 )
35
36     # everything is fine if the expression isn't nested
37     traceback.TracebackException.from_exception(
38         exc,
39         limit=limit,
40         lookup_lines=lookup_lines,
41         capture_locals=capture_locals,
42         # copy the set of _seen exceptions so that duplicates
43         # shared between sub-exceptions are not omitted
44         _seen=set(_seen),
45     )
46
47
48 # %%