The multi line editing change is awesome. It was so annoying to accidentally close out the multi line code and have to re-enter each line toggling through history one by one.
Julia's REPL is great! It is also the inspiration for radian, an alternative REPL for R (written in Python!) which I always use now if I'm not in the IDE.
I had forgotten about exit() because I always use Ctrl-D, but colours, better indicators on exceptions, and multi-line editing are all fantastic things I'm looking forward to.
i'm glad to be reminded of `exit()` because IPDB breakpoints get easily borked when doing async stuff, causing the terminal to stop intercepting CTRL commands. Up until now, I either closed the TTY or sent a kill signal to the PID, but `exit` works way better (and is already standard in iPython)
7:48 : I think this is an implementation of bracketed paste (which is basically a terminal feature, but a pretty common one). The action of pasting , when received by the terminal, "prints" certain control codes indicating the beginning and end of a paste block. 3.13 appears to interpret these and therefore can actually tell the difference between 'the user typing a pile of individual lines' and 'pasting a block of text'.
So there is a little bit of inspiration from IPython, am I right? I love when a 3rd party package works so well and someday made its way into the official repo.
It's mainly based on PyPy's, though I'd be surprised if they didn't take _some_ inspiration from it. I know they intentionally didn't go as far as IPython does though.
@@Carberra I think some parts of it would be enough. Because i mostly use that parts / features. I know it's personal but i like it anyway. I like how independent devs and communities contribute the user experience of the official end product, anyway. But i understand your point. You are right ofcourse.
PyPy is a third-party, so technically that is still happening! I didn't mention it in the video, but the new REPL is built in Python, meaning it'll be much easier for Python devs to contribute back into it!
@@CarberraI hope ^l is in the new repl too (arguably both `clear` and ^l are standard ways of doing this in command shells like bash, so it would make sense to support both IMO)
I first encountered auto indentation and paste mode with the micropython REPL a couple weeks ago. Now that I have gotten used to it, I think I like it more than the regular REPL.
Yes, multiline editing looks improved - I hated the old way. Things like 'exit" (or 'quit', which is what I normally used) needing () was never a problem for me - it's Python, and they're functions - but I can see how some people would like it better - they intuit that 'exit' should be a REPL command, and not a Python function. I haven't tried it, but paste *might* let you paste from the terminal (that is, key in lines manually, not from the buffer) as well as paste from the buffer. This would let you do multiblock pasting while interspersing a line of interface between blocks. Still seems like an almost insignificant difference, though.
Thanks for doing this video! Do you happen to know if there's a capability of instead of doing multiline editing "inline" you can instead have the multiline editing text sent off to the $EDITOR (i.e. an Emacs server) so you can edit it there instead? Bash has this capability with the `fc` command. It allows one to use any custom editing macros or templates that you've created or installed to speed up the editing, as well as being able to easily copy/paste from another buffer in the editor server into the multiline text being edited. `fc` works with the entire content of the last command, even if it's a multiline command.
@@AlamKhan-yt9wd an improved Python repl that has been around for years and supports many features like auto completion, color, references to executed commands and more (there are many but idk all of them)
I really hope they add module reloading (is this already a thing? I've never been able to find a way). In the Haskell repl you can type `:r` and it will reload any module file that has changed. Super helpful and doesn't require exiting the repl.
Colour selection; it sounds like there was little thought toward the ~7% of men who have a colour vision deficiency? Or, can users select a colour palette designed to work with the typical red/green problems? It's just a thought.
Yeah -- I didn't see it either -- the video was talking about paste mode, but didn't make it plain (and as a native English speaker for > 60 years, I don't think it was lost in translation) what put you into paste mode. It's like suddenly, as if by magic, you're in paste mode. If you blinked, you didn't hear about the F1 to go into help mode either, so maybe there's an F key that enables paste mode?
man i just use xonsh and it's a shell with all the issues you talked about that dont exist a shell, not just interactive python. so i can execute `ls /bin` or `ls @(mydirectoryvariable)`
You can use the PYTHON_COLORS environment variable to disable colours, and PYTHON_BASIC_REPL to disable the autoindenting (by disabling the new REPL in its entirety).
@@Carberra I like some of the features like multiline editing, though. I just can't stand colors and the automated syntax like autoindent. I hope they provide an option to just disable it
The REPL executes after two new lines. If you have two new lines in your class definition, it beaks on paste. In paste mode, it doesn’t do that… I presume.
@@Carberra sorry you missed my point 😊 clear and exit can hardly be considered new, as they already worked before. They were obscure key bindings like F1 and f2.
Looks like pythons slowly getting feature parody with clojure. Nice to see considering the mistake of ml and ai ending up being built on top of python.
Few people appreciate clojure, unfortunately. Even back in the 70s INTERLISP had the DWIM facility -- doing auto spelling correction, I think completion, and allowing reediting of commands and lots of other amazing things. It was truly ahead of its time, and made doing REPL development a joy. I should probably do more clojure hacking -- it's a cool language that's portable has heck, and interoperable with Java (and the JVM) which is a big plus.
I use it to quickly test things without having to create a file and save it to disk, but one of the main motivations for improving this was that a lot of people get taught in the REPL to begin with before moving onto an editor. I was quite surprised to hear that myself, but that's an official stance.
I think it's important to realize Python is known for being a beginner language, but I'm unsure how one would use it once they're past that initial beginner stage and are used to developing on larger projects. Even if you want to continue using something lightweight, there are plenty of tools that allow for ephemeral, lightweight, portable, and language agnostic building, testing, code execution environments.
@@mudi2000a yeah I get that. If I want to quickly try or test something, I just open up one of my test_72384.ipynb jupyter notebooks and chuck it in there :D I get syntax highlight, intellisense, etc and dont have to limit myself to a terminal.
it stands for Read-Eval-Print Loop because that's how it works - it reads input from you, evaluates the code you typed, prints the output, and then repeats the process over and over again
There is! You can set the PYTHON_COLORS environment variable to 0 to disable colour, and the PYTHON_BASIC_REPL variable to 1 to disable the new REPL entirely.
It would be great of YT creators got past describing what they are going to talk about when it is a 10 minute video. Why would anyone click (or you want them to click) if they don't know what it is? And the title says what you are going to talk about. See Project Farm or Scotty Kilmer for how to just launch in this age of fast media. Q: How do you get color in a dumb terminal? This must assume you are on a PC. Not a serial connection to an embedded system? Anyway, why didn't you fix your errors? Why do I have to watch them? Criminy!
The multi line editing change is awesome. It was so annoying to accidentally close out the multi line code and have to re-enter each line toggling through history one by one.
Oh my god, yes, this shit.
It ends up being easier to just create and run an entire new python file then to interact with the terminal.
@@wrathofainz lol yup. I mean, yeah we have ipython but its so much easier to just pull up a terminal
@@randyt700 I just meant when testing individual functions and classes and stuff.
I always have a terminal open, its built into the file browser :)
Agree, easier now
@@randyt700you just reminded me to reinstall bpython, thanks (legitimately)
I forgot that Python has it's own REPL. * Insert obligatory "I use IPython" comment here *
ptpython is cooler.
Love how you compare the terminals side by side. Nicely presented 👍🏻
Thank you!
I'll second that -- it was a great, fast way to show very directly the differences!
exit in new python REPL has been a godsend
I always use CTRL+D to exit, so never really ran into that annoyance, but the new way certainly does make much more sense.
exit() was a minor pain.
Just type exit()...
I like the fact that `exit` is now standard across top level REPL, help mode, etc, instead of having each "mode" have its own way to exit that mode.
@@squishy-tomatoctrl+d makes it easy to accidentally exit the top-level shell right after exiting Python repl
Julia has an even nicer repl. To get into help mode, just press "?" To exit it, just press backspace again.
Julia's REPL is great! It is also the inspiration for radian, an alternative REPL for R (written in Python!) which I always use now if I'm not in the IDE.
Cant wait to try it
I had forgotten about exit() because I always use Ctrl-D, but colours, better indicators on exceptions, and multi-line editing are all fantastic things I'm looking forward to.
i'm glad to be reminded of `exit()` because IPDB breakpoints get easily borked when doing async stuff, causing the terminal to stop intercepting CTRL commands. Up until now, I either closed the TTY or sent a kill signal to the PID, but `exit` works way better (and is already standard in iPython)
7:48 : I think this is an implementation of bracketed paste (which is basically a terminal feature, but a pretty common one). The action of pasting , when received by the terminal, "prints" certain control codes indicating the beginning and end of a paste block. 3.13 appears to interpret these and therefore can actually tell the difference between 'the user typing a pile of individual lines' and 'pasting a block of text'.
Ah nice, thanks for that!
simple and to the point, thank you
I've been using the ptpython repl for years, which gives most/all of these benefits and works on earlier versions of Python
So there is a little bit of inspiration from IPython, am I right? I love when a 3rd party package works so well and someday made its way into the official repo.
It's mainly based on PyPy's, though I'd be surprised if they didn't take _some_ inspiration from it. I know they intentionally didn't go as far as IPython does though.
@@Carberra I think some parts of it would be enough. Because i mostly use that parts / features. I know it's personal but i like it anyway. I like how independent devs and communities contribute the user experience of the official end product, anyway. But i understand your point. You are right ofcourse.
PyPy is a third-party, so technically that is still happening! I didn't mention it in the video, but the new REPL is built in Python, meaning it'll be much easier for Python devs to contribute back into it!
you can clear the old repl with ctrl-l
Huh, I didn't know that! Clear command is definitely more clear though (if you'll excuse the pun!).
Also works in the terminal (normally)
@@CarberraI hope ^l is in the new repl too (arguably both `clear` and ^l are standard ways of doing this in command shells like bash, so it would make sense to support both IMO)
Yeah, it works! Ignore my last comment, I read it as CTRL+I (I for India) rather than CTRL+L, rip.
Tried Ctrl+I, didn't work, glad i did Ctrl+L after
That "complex" help is from "less", the linux pageR. It's read from env var PAGER.
Hey look it’s just like ipython :). Nice to have without the extra dependency though.
I use the ipython command from jupyter for a repl instead of the default one. Nice to see the default shell is getting up there too now!
Thanks for the video. FYI, ^L clears clears screen on the old repl (tested on mac and Linux).
I think this is true for generally anything that uses the readline library for handling input (so bash gets it too).
really nice, thanks for this!
I first encountered auto indentation and paste mode with the micropython REPL a couple weeks ago. Now that I have gotten used to it, I think I like it more than the regular REPL.
Great information. Thanks!
I’ve never written Python. It looks cool. I have prompted a few programs.
Awesome!
ipython has had this forever
Omg these changes are great
by the way: to log out of any terminal session, you can generally use Ctrl+D, which sends a logout command
Conclusion in one sentence: python repl is now ipython. Skip ipython for the future.
I’ve been using ptpython instead of the built in repl and I think I will stick to that for now.
Glad to see the 3rd party stuff find its way back up stream. Wonder if Mojo inspired any of the new jit.
Well, I am sold with the purple prompt. The '(' and ')' characters are going to get lonely.
I am using bpython right now, not sure this new repl will change a lot
Holy hell, just looked that up and it looks awesome! Will have to try that.
Yes, multiline editing looks improved - I hated the old way. Things like 'exit" (or 'quit', which is what I normally used) needing () was never a problem for me - it's Python, and they're functions - but I can see how some people would like it better - they intuit that 'exit' should be a REPL command, and not a Python function. I haven't tried it, but paste *might* let you paste from the terminal (that is, key in lines manually, not from the buffer) as well as paste from the buffer. This would let you do multiblock pasting while interspersing a line of interface between blocks. Still seems like an almost insignificant difference, though.
Thanks for doing this video! Do you happen to know if there's a capability of instead of doing multiline editing "inline" you can instead have the multiline editing text sent off to the $EDITOR (i.e. an Emacs server) so you can edit it there instead? Bash has this capability with the `fc` command. It allows one to use any custom editing macros or templates that you've created or installed to speed up the editing, as well as being able to easily copy/paste from another buffer in the editor server into the multiline text being edited. `fc` works with the entire content of the last command, even if it's a multiline command.
w.r.t. clear, it was always possible to use Ctrl-L though, which clears the screen like `clear` in ~all terminal programs ;)
Feels like the "CAR BER RA" sign in the background needs explanation 🙂
It's the channel's name 😅
@@Carberra LOL. For some weird reason I thought this was a subtle way of saying you were in Canberra.
Google thought the same for about two years, so you're not the first lmao. Didn't realise how similar it was until it was too late!
What about the JIT :(
Damn finally, ty python
I only used repl to convert dec to hex, I'm sure those features will come handy
who uses python repl, just use ipython
What is ipython?
@@AlamKhan-yt9wd an improved Python repl that has been around for years and supports many features like auto completion, color, references to executed commands and more (there are many but idk all of them)
Try that in a remote server you are just giving maintenance.
because it's a default, and having good defaults is good
Some work environments look you down pretty heavily.
I really hope they add module reloading (is this already a thing? I've never been able to find a way). In the Haskell repl you can type `:r` and it will reload any module file that has changed. Super helpful and doesn't require exiting the repl.
You can probably use importlib.reload(module).
I use "ipython", but maybe I'll switch to this.
***cough** **cough** Ctrl+L **cough** --easier to type than 'clear' , Just Works™
Please stop smoking.
I love how ^L is something new to these younger guys who try to present themselves overconfidently as uber-hackers.
@@jamesbond_007 As my father loved to say “Quick hire a teenager while they still know it all!”
Why use exit and clear when you can use Ctrl-D and Ctrl-L?
Colour selection; it sounds like there was little thought toward the ~7% of men who have a colour vision deficiency? Or, can users select a colour palette designed to work with the typical red/green problems?
It's just a thought.
You can't select a palette (yet), but you can turn the colours off entirely using environment variables.
Good point. Things like this should at least be aware of accessibility issues, and allow accommodations. I'm glad you brought this up!
How to enter the paste mode? Maybe I lost it in translation.
Yeah -- I didn't see it either -- the video was talking about paste mode, but didn't make it plain (and as a native English speaker for > 60 years, I don't think it was lost in translation) what put you into paste mode. It's like suddenly, as if by magic, you're in paste mode. If you blinked, you didn't hear about the F1 to go into help mode either, so maybe there's an F key that enables paste mode?
I know this late, but F3 for paste mode. The "What's new" part of the standard docs for Python 3.13 cover the new REPL fairly well.
man i just use xonsh and it's a shell with all the issues you talked about that dont exist
a shell, not just interactive python. so i can execute `ls /bin` or `ls @(mydirectoryvariable)`
Most importantly, how does one disable colors and autoindent?
You can use the PYTHON_COLORS environment variable to disable colours, and PYTHON_BASIC_REPL to disable the autoindenting (by disabling the new REPL in its entirety).
@@Carberra I like some of the features like multiline editing, though. I just can't stand colors and the automated syntax like autoindent. I hope they provide an option to just disable it
Can I press up on a multi line and go into the cursor and highlight multi lines at a time and cut out directly? :3
The REPL executes after two new lines. If you have two new lines in your class definition, it beaks on paste. In paste mode, it doesn’t do that… I presume.
Wow
So, the ^l and ^d are too hard, but F1 and f2 are totally fine?
Hm? ^L and ^D work fine.
@@Carberra sorry you missed my point 😊 clear and exit can hardly be considered new, as they already worked before. They were obscure key bindings like F1 and f2.
F1 for help is universal on Windows and Mac. Works in nearly every application. F2 you need to memorize…
In vim paste mode will disable auto-indent
ipython 😅
They need to handle the f key state or something
Ipython
Looks like pythons slowly getting feature parody with clojure. Nice to see considering the mistake of ml and ai ending up being built on top of python.
Few people appreciate clojure, unfortunately. Even back in the 70s INTERLISP had the DWIM facility -- doing auto spelling correction, I think completion, and allowing reediting of commands and lots of other amazing things. It was truly ahead of its time, and made doing REPL development a joy. I should probably do more clojure hacking -- it's a cool language that's portable has heck, and interoperable with Java (and the JVM) which is a big plus.
Ptpython still beter imho
Does this mean I don't need to use bpython anymore.... I shall find out with the rest of the video
can anyone enlighten me why would anyone use this instead of an IDE?
I use it to quickly test things without having to create a file and save it to disk, but one of the main motivations for improving this was that a lot of people get taught in the REPL to begin with before moving onto an editor. I was quite surprised to hear that myself, but that's an official stance.
I think it's important to realize Python is known for being a beginner language, but I'm unsure how one would use it once they're past that initial beginner stage and are used to developing on larger projects. Even if you want to continue using something lightweight, there are plenty of tools that allow for ephemeral, lightweight, portable, and language agnostic building, testing, code execution environments.
Because you don’t need a file. I use pycharm but I still use the repl (albeit ipython or the pycharm integrated one) all the time.
@@mudi2000a yeah I get that. If I want to quickly try or test something, I just open up one of my test_72384.ipynb jupyter notebooks and chuck it in there :D I get syntax highlight, intellisense, etc and dont have to limit myself to a terminal.
I just use `py -m idlelib`
people genuinelymuse the repl terminal? fer why? the damn page edito4 the code written, get this, is still there if leave and come back😊
and multiline
so the name is REPL, i just call it interactive shell.😅
To be honest I always thought it was just the interactive shell too, until very recently! Both terms are fine though as far as I know.
it stands for Read-Eval-Print Loop because that's how it works - it reads input from you, evaluates the code you typed, prints the output, and then repeats the process over and over again
The colorization is not a good thing for people with color deficient vision. I wish there was a way to turn it off.
There is! You can set the PYTHON_COLORS environment variable to 0 to disable colour, and the PYTHON_BASIC_REPL variable to 1 to disable the new REPL entirely.
Calfreezy?
Nice, but Python 3.14 will be much better.
π
Yep, the REPL will be easy as pi.
As a user of ipython, improvements on the repl are not a big news...
So cool. What's next? Mouse support?
Its “gih” it not “jih” it. Gosh didnt we learn from gifs?
Not sure what word this is relating to, can you clarify?
It would be great of YT creators got past describing what they are going to talk about when it is a 10 minute video. Why would anyone click (or you want them to click) if they don't know what it is? And the title says what you are going to talk about. See Project Farm or Scotty Kilmer for how to just launch in this age of fast media.
Q: How do you get color in a dumb terminal? This must assume you are on a PC. Not a serial connection to an embedded system?
Anyway, why didn't you fix your errors? Why do I have to watch them? Criminy!
yyyyy yyy
Python 2, print without brackets
Python 3, print with brackets, exit without brackets
Python 4, ??
It feels like history repetition
Brackets without print
truly amazing 70s new tech, lol.
colors are a mistake, just make things clear, without colors, it's not that hard. must be rust programmers.
You plebs still using stock REPL? What’s wrong with you people?
Perhaps you need to prepare before you make videos
Perhaps if you have a criticism, you could actually say what I did wrong so I could improve for next time. Vague comments like this don't help anyone.
Looks useless compared to ipython
It is very difficult to understand you. Too fast and mumbling