question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vinayak-mehtacommented, Nov 14, 2019

@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.

0reactions
vinayak-mehtacommented, Nov 15, 2019

??func should work.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found