Author bup
Recipients bup, grantjenks, rhettinger, taleinat, terry.reedy, xtreak
Date 2019-01-02.15:50:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546444236.8.0.953099181482.issue35196@roundup.psfhosted.org>
In-reply-to
Content
Not 100% sure if it's appropriate to post this here... so sorry if not. 

So anyway, the _MAX_COLS and _MAX_LINE constants used for `get_argspec` seem like they were intended to limit the generated text tips to at most 5 rows, 85 characters wide, which makes sense, but isn't what happens at all.

Easy to just post an example of how the call signature isn't limited in any meaningful way, which can easily lead to a call tip millions of character long that obviously cannot be rendered and can maybe cause crashes:

# freshly started repl session
>>> if 1:
        from idlelib.calltips import get_argspec
        G = globals()
        @get_argspec
        def func(x, d=G): pass
        print('len of func signature:', len(func))
        print(f'len(repr(globals())): {len(repr(G)):_} ({len(G)} globals)')

len of func signature: 564
len(repr(globals())): 899 (10 globals)
>>> from numpy import *
>>> if 1:
        from idlelib.calltips import get_argspec
        G = globals()
        @get_argspec
        def func(x, d=G): pass
        print('len of func signature:', len(func))
        print(f'len(repr(globals())): {len(repr(G)):_} ({len(G)} globals)')
...
len of func signature: 45524
len(repr(globals())): 92_488 (604 globals)
History
Date User Action Args
2019-01-02 15:50:38bupsetrecipients: + bup, rhettinger, terry.reedy, taleinat, grantjenks, xtreak
2019-01-02 15:50:36bupsetmessageid: <1546444236.8.0.953099181482.issue35196@roundup.psfhosted.org>
2019-01-02 15:50:36buplinkissue35196 messages
2019-01-02 15:50:36bupcreate