def square(x):
"""Can you see me?"""
return x*x
Hover over square
and see an underline appear; press Ctrl
to display tooltip with the docstring.
result = square(2)
This import is underlied as it should be placed at the top of the file; it has an orange underline as this is only a warning.
from statistics import mean
You can also hover over statistics and mean (while holding Ctrl
) to see the documentation of those.
if there is invalid syntax:
pass
File "<ipython-input-4-23d47aab6817>", line 1 if there is invalid syntax: ^ SyntaxError: invalid syntax
you will see red underline ("invalid" and "syntax" above are two expressions which canno be place next to each other without an operator)
Also, spurious whitespaces can be highlighted (if server supports such diagnostic):
class Dog:
def bark(self):
print('🐕 woof woof')
Dog().bark()
🐕 woof woof
Empty cells will cause "too many blank lines" warning as each cell is padded with two new lines. If we remove the blank cell, everything will be perfect!
class Cat:
def miaow(self):
print('miaow')
Autocompletion works without the kernel - try completing "Cat" below using Tab, without running the cell above:
Ca
You can see that all the double-dunder methods of the class are immediately available:
Cat.__
In future, it will automatically invoke the completion suggestions after typing a dot (.):
Cat