Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Python 3.x Progress Update
-
@omz By the way, how about that keyboard dismiss? The way it is now is not so convenient since it actually makes you scroll the code and lose the position. A button or something like that would be great :) Is that a possibility or you've completely switched to swiping down?
-
@Leva7 I think I'll keep it the way it is. It's pretty difficult to find a place for a "dismiss keyboard" button on such a small screen.
-
I just registered here after seeing this thread.
I am a new python programmer and am - right now - shunning 2.7 as I am starting to learn python on 3.xThis is the best news ever and I am anciously awaiting the full release.
Best,
zielperson -
@omz A few suggestions regarding the new autocomplete feature:
- When the user has fully typed a suggestion out by hand, then make Enter behave like normal and insert a newline. The current behavior can be a little surprising, for example when typing
return self
you need to hit Enter twice to insert a newline - first to accept the suggestion, then for the newline. Same goes for typing a bare variable name in the interactive prompt to display it. - Related to the previous suggestion - when there is only one suggestion and that has been fully typed out, hide the suggestion popup entirely.
- Allow dismissing the suggestion popup with Escape on an external keyboard.
- Please take the caps of what the user typed in account when showing suggestions. When I write
typ
, I probably wanttype
, and when I writeTyp
, I probably wantTypeError
.
- When the user has fully typed a suggestion out by hand, then make Enter behave like normal and insert a newline. The current behavior can be a little surprising, for example when typing
-
Also, how hard would it be to check for a
@property
decorator in the autocomplete and then not put in parentheses? -
Any decorator really should not have parentheses added automatically. Some decorators allow arguments using closures, but there are many that do not take arguments and do not even allow empty parens. This includes most built-in decorators, like
property
,classmethod
andstaticmethod
.Speaking of parens - when editing an already typed line, the autocompletion often inserts extra parens before an existing function call. For example, say I have this line of code:
mylist.append("foo")
Then I decide I want to use
insert
instead. I double-tapappend
, typeins
, and hit Enter to accept the suggestion. The output I get ismylist.insert()("foo")
In this case I would expect it to detect the existing parens and not add extra ones.
-
I will admit I didn't like the insensitive matching originally, but zi do find it useful in objc... though I agree the typed case should be given priority to other matches.
Also, i think attributes starting with underscores should have lower priority (unless user starts typing an underscore). Pretty much every object has a dozen magic double underscore attributes which are rarely needed -- put _ and __ at the end of the non-matching list. -
Idea: add "show docstring", or else when using help on a non builtin, show the docstring. It might also be neat to show a "ghost" of the signature when typing a method to remind one of the arguments and ordering.
-
@JonB Both awesome ideas.
-
@omz
objc_util.on_main_thread
still doesn't usefunctools.wraps
to copy docstrings and such:>>> help(notification.schedule) Help on function new_func in module objc_util: new_func(*args, **kwargs) Out[0] = None >>> help(notification.schedule.__closure__[0].cell_contents) Help on function schedule in module notification: schedule(message, delay=0, sound_name=None, action_url=None) Note: Sounds from the 'digital' and 'game' collections ate supported Out[1] = None
Also, "ate supported".
;)
-
@omz is there a way to kill rogue scripts that call ui.Delay for example. In py2 you could keep hitting the close button until,it finally stopped. This seems not to work now. I have to force quit and restart py3. Maybe there is a new way I don't know about
-
If you are still,able to type in the console, ui.cancel_all_delays might work. Alternatively, deleting a module that the function depends on is a sure way to induce an Exception that stops it. e.g
del sys.modules ['ui']
-
@JonB l well I got around it by just making sure it didn't go rogue 😜
But honestly, I can force quit Pythonista and restart it quicker than I can type cmds into the console. My iPad Pro is lighting fast, also helps with the animations turned off globally -
you could always create an editor action script that cancels all delays!
-
@ywangd Is the Stash branch py3 still recommended, or is the master release now working well in pythonista 3 using #!python2?
-
@pvanallen i have not gotten around to porting git to handle py3. Also, I don't think there are any py3 only commands -- So #!python2 is currently the best option, unless you want you use the
python
command to run py3 scripts. -
Hi. Is it possible to get onto the beta list ? I have just bought 2.0 and am loving it. I would love to have the Python 3.x version as my 10 year old son is learning Python ATM and the book he is using needs Python 3.x. Please help :)
-
@farscapeone You can use this form to sign up (it might take a couple of days until you actually get an invite, I'm not checking the responses all the time): https://docs.google.com/forms/d/10qRhNIvk7WzcR5_DsQSRNIqLkIqeTYYafbPi9bjj_cw/viewform
-
I'd rather like an ETA, to be honest.
Any idea?
::z::
-
@JonB Thanks for the recommendation - got the standard py2 version installed (which has the #!python2 already in launch_stash.py).
For others, if they want to install the py2 StaSh for py3 in the beta, be sure to switch the Console Interpreter Version to Python 2.7 before you install StaSh. After installing, restart Pythonista and switch back to 3.5 as the interpreter.
Overall, StaSh seems to be working well in the beta. I have seen some cases where Pythonista crashes when using StaSh. It seems to happen when an error message from StaSh is shown in the Pythonista console tab.
Anyway, I used StaSh's pip command to install NLTK and then used nltk.download() in the standard console to install the book corpora (using the default directory worked without needing to explicitly set the NLTK_DATA environment variable). So far, so good!