omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    56
    395
    526463
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Webmaster4o
      Webmaster4o last edited by

      Also, how hard would it be to check for a @property decorator in the autocomplete and then not put in parentheses?

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        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 and staticmethod.

        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-tap append, type ins, and hit Enter to accept the suggestion. The output I get is

        mylist.insert()("foo")
        

        In this case I would expect it to detect the existing parens and not add extra ones.

        1 Reply Last reply Reply Quote 2
        • JonB
          JonB last edited by

          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.

          Webmaster4o 1 Reply Last reply Reply Quote 2
          • JonB
            JonB last edited by

            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.

            1 Reply Last reply Reply Quote 4
            • Webmaster4o
              Webmaster4o @JonB last edited by

              @JonB Both awesome ideas.

              1 Reply Last reply Reply Quote 0
              • dgelessus
                dgelessus last edited by

                @omz objc_util.on_main_thread still doesn't use functools.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". ;)

                1 Reply Last reply Reply Quote 0
                • Phuket2
                  Phuket2 last edited by

                  @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

                  1 Reply Last reply Reply Quote 0
                  • JonB
                    JonB last edited by

                    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']

                    Phuket2 1 Reply Last reply Reply Quote 0
                    • Phuket2
                      Phuket2 @JonB last edited by

                      @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

                      1 Reply Last reply Reply Quote 0
                      • JonB
                        JonB last edited by

                        you could always create an editor action script that cancels all delays!

                        1 Reply Last reply Reply Quote 1
                        • pvanallen
                          pvanallen last edited by

                          @ywangd Is the Stash branch py3 still recommended, or is the master release now working well in pythonista 3 using #!python2?

                          JonB 1 Reply Last reply Reply Quote 0
                          • JonB
                            JonB @pvanallen last edited by

                            @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.

                            1 Reply Last reply Reply Quote 0
                            • farscapeone
                              farscapeone last edited by

                              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 :)

                              1 Reply Last reply Reply Quote 0
                              • omz
                                omz last edited by

                                @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

                                farscapeone 1 Reply Last reply Reply Quote 0
                                • zielperson
                                  zielperson last edited by

                                  I'd rather like an ETA, to be honest.

                                  Any idea?

                                  ::z::

                                  1 Reply Last reply Reply Quote 0
                                  • pvanallen
                                    pvanallen last edited by

                                    @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!

                                    1 Reply Last reply Reply Quote 0
                                    • lukaskollmer
                                      lukaskollmer last edited by

                                      @omz you could use boarding to automate inviting new beta testers.

                                      Example:
                                      https://tf-boarding-grades-ios.herokuapp.com/

                                      1 Reply Last reply Reply Quote 0
                                      • JonB
                                        JonB @omz last edited by JonB

                                        @omz not sure if the latest beta broke this, or if it is by design: when running the 2.7 interpreter, after running a script in Documents, site-packages is modified and no longer points to the pythonista3 site-packages.

                                        This got me when installing pyimgur then was unable to import using 2.7 but was able to import with 3.5, or after restarting.

                                        after running script:

                                        private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Pythonista3/Documents', '/private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Documents/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages/PIL_compat']
                                        

                                        before

                                        
                                        ['/private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Documents/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages/PIL_compat', '/private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Pythonista3/Documents/site-packages']
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • farscapeone
                                          farscapeone @omz last edited by

                                          @omz Thanks - I have just done that

                                          1 Reply Last reply Reply Quote 0
                                          • pvanallen
                                            pvanallen last edited by

                                            @omz I'm seeing an error when using 2to3 from the wrench on the example from the linguistictagger docs page. In editor.py it says "name 'os' is not defined" line 161. This is using the 300012 version just released.

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors