bundles / IPython 9.17.0 / IPython / utils / tokenutil / token_at_cursor
function
IPython.utils.tokenutil:token_at_cursor
Signature
def token_at_cursor(cell: str, cursor_pos: int = 0) → strSummary
Get the token at a given cursor
Extended Summary
Used for introspection.
Function calls are prioritized, so the token for the callable will be returned if the cursor is anywhere inside the call.
Parameters
cell: strA block of Python code
cursor_pos: intThe location of the cursor in the block where the token should be found
Aliases
IPython.utils.tokenutil.token_at_cursor