X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/d90297c77bab6e22831b05ffc099bfc709cc7785..d1aee5f7fa136b1f0a7d8dfc318af81009074070:/.vim/bundle/black/tests/data/cases/comments3.py?ds=inline diff --git a/.vim/bundle/black/tests/data/cases/comments3.py b/.vim/bundle/black/tests/data/cases/comments3.py new file mode 100644 index 0000000..f964bee --- /dev/null +++ b/.vim/bundle/black/tests/data/cases/comments3.py @@ -0,0 +1,48 @@ +# The percent-percent comments are Spyder IDE cells. + + +# %% +def func(): + x = """ + a really long string + """ + lcomp3 = [ + # This one is actually too long to fit in a single line. + element.split("\n", 1)[0] + # yup + for element in collection.select_elements() + # right + if element is not None + ] + # Capture each of the exceptions in the MultiError along with each of their causes and contexts + if isinstance(exc_value, MultiError): + embedded = [] + for exc in exc_value.exceptions: + if exc not in _seen: + embedded.append( + # This should be left alone (before) + traceback.TracebackException.from_exception( + exc, + limit=limit, + lookup_lines=lookup_lines, + capture_locals=capture_locals, + # copy the set of _seen exceptions so that duplicates + # shared between sub-exceptions are not omitted + _seen=set(_seen), + ) + # This should be left alone (after) + ) + + # everything is fine if the expression isn't nested + traceback.TracebackException.from_exception( + exc, + limit=limit, + lookup_lines=lookup_lines, + capture_locals=capture_locals, + # copy the set of _seen exceptions so that duplicates + # shared between sub-exceptions are not omitted + _seen=set(_seen), + ) + + +# %% \ No newline at end of file