Cannot parse ?? when specified at the end of function name
See original GitHub issue@vinayak-mehta thanks for handling #9 so quickly! I just upgraded nbcommands, and I think I might have found one more edge case, I hope you don’t mind me reporting this here.
There are some code cells where we want to show the source of the function, so we write:
func_name??
to show the full source, or
func_name?
to show just the signature + docstring (if I remember correctly).
This example, I think, also gave me an error, this time being:
black.InvalidInput: Cannot parse: 1:6: func_name??
I dug into the source, and saw that you basically added a regex replacement, is that right? Would the correct thing to do here be the following? I think the order has to be the double-?? before the single-?.
source = re.sub("^??", "#??", source, flags=re.M)
source = re.sub("^?", "#?", source, flags=re.M)
# followed by...
black_source = re.sub("^#??", "??", black_source, flags=re.M)
black_source = re.sub("^#?", "?", black_source, flags=re.M)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
The specified value cannot be parsed, or is out of range when ...
When I get my object I format a number with a pipe but it returns this warning and the value isn't displayed. If...
Read more >SyntaxError: function statement requires a name - JavaScript
The JavaScript exception "function statement requires a name" occurs when there is a function statement in the code that requires a name.
Read more >Parsing arguments and building values — Python 3.11.1 ...
Parse the parameters of a function that takes both positional and keyword parameters into local variables. The keywords argument is a NULL -terminated...
Read more >SML/NJ Error Messages
Parsing Errors This error message indicates how the parser attempted to "repair" the input (from a file foo. sml), and in this case...
Read more >6 Deciphering Common R Errors | Getting Used to R, RStudio ...
6.1 Error: could not find function ... packages you will be using in the top R chunk in your R Markdown file, which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@ericmjl I wasn’t able to check this out, would you like to raise a PR for this? I’ve never used the
??syntax so wasn’t aware of this edge case.??funcshould work.