Forum Archive

os.walk()

SteppenwolfUA

Hi!

I've got the following problem: every time I try to type os.walk(someroot) in editor and enter dot (to type next() for example) Pythonista crashes.

Is this just a peculiarity on my iPad or is this a general bug?

I would appreciate any hints. Thanks

omz

Seems like a bug, I can reproduce the behavior here on different devices. I'll look into it, thanks!

SteppenwolfUA

I don't get this behaviour when typing the same in console. Copy pasting into editor works fine, but is awkward.

Thank you so much for your prompt response.

dgelessus

The console and editor use different completion mechanisms. In the console, Pythonista looks at the live objects using something like dir and gets the name lists that way. In the editor, it uses the jedi library to analyze your (and the standard library) Python code and generates name lists based on that.

PS:

It doesn't seem to like generators in general. Sometimes even this crashes (but sometimes it doesn't):

def i_crash():
    yield 42

i_crash(). # crash
SteppenwolfUA

I've reproduced your generator example and it did indeed crash... So it's copy-paste with generators for now, until some solutions shows up. Thank you for the insights, anyway!