pytest-dev / py

Python development support library (note: maintenance only)
MIT License
69 stars 105 forks source link

py.code.Source.deindent is too smart for its own good #21

Closed pytestbot closed 7 years ago

pytestbot commented 8 years ago

and seems to hang in troublesome ways on big files

pytestbot commented 8 years ago

Original comment by @RonnyPfannschmidt

i took a quick look, i referenced the code in pypy that triggered it in issue #184 (that code triggered both of the related issues)

pytestbot commented 8 years ago

Original comment by @RonnyPfannschmidt

if i remember correct, some grossly oversized functions from pypy triggered the behaviour (in pypy we monkeypatched it to use the textwrap function)

pytestbot commented 8 years ago

Original comment by @hpk42

question is if there are any concrete use cases which trigger the bad behaviour ...

pytestbot commented 8 years ago

Original comment by @RonnyPfannschmidt

this is a different issue, deindent using tokenize is stll vastly slower than a non-smart deindent

pytestbot commented 8 years ago

Original comment by @hpk42

i guess the deindent problem is gone now due to the new AST-checking.

pytestbot commented 8 years ago

Original comment by @RonnyPfannschmidt

im pypy i had to introduce a monkeypatch to py.code.Source.deindent to bring the wait time from #22 from more than just a few minutes down to a bearable 5 seconds

pytestbot commented 8 years ago

Original comment by @hpk42

examples?