donkirkby/live-py-plugin

Failure with long function signature

donkirkby opened this issue · 0 comments

What I did

I wrote a function with a return value type hint, and then called a different function.

import typing


def bar(x):
    return x * 2


def nok() -> typing.Tuple[
        int]:
    pass


print(bar(42))

What happened

When I ran it with space_tracer, the display was blank.

> space_tracer example.py 
import typing              |
                           |
                           |
def bar(x):                |
    return x * 2           |
                           |
                           |
def nok() -> typing.Tuple[ |
        int]:              |
    pass                   |
                           |
                           |
print(bar(42))             |

If I made the function name one character shorter, then the display looks normal.

> space_tracer example.py 
import typing             |
                          |
                          |
def bar(x):               | x = 42
    return x * 2          | return 84
                          |
                          |
def ok() -> typing.Tuple[ |
        int]:             |
    pass                  |
                          |
                          |
print(bar(42))            | print('84')

Switching the signature to fit on one line also fixes it.

What I wanted to happen

Both versions should display fine.

My environment

  • Space Tracer 4.11.3
  • Ubuntu 22.04
  • Python 3.12.1