[Python-ideas] Re: Bringing the print statement back

2022-03-02 Thread Juancarlo Añez
On several functional languages that allow function invocations without enclosing arguments in parentheses all functions take a single argument. For multiple arguments the single argument is a tuple. For no arguments the single argument is an empty tuple. I've read the comments and I see more

[Python-ideas] Re: Bringing the print statement back

2022-02-24 Thread Josiah (Gaming32) Glosson
This idea reminds me of a similar feature in Groovy. I really like this feature because it allows application developers to let users write Python code that is very English-like (more than Python already is). ___ Python-ideas mailing list --

[Python-ideas] Re: Bringing the print statement back

2020-10-27 Thread Daniel.
My little contribution I will always prefer expressions over statements. So, -1 for bringing back a statement for something that we have a function for. Functions are first citizens, statement are not Now if we are talking about parenthesesless expressions, if we're designing a language from

[Python-ideas] Re: Bringing the print statement back

2020-10-23 Thread Robert Vanden Eynde
That makes me think of ruby where you can omit some of the function call. On Wed, Jun 10, 2020, 02:08 Guido van Rossum wrote: > In Python 3.10 we will no longer be burdened by the old parser (though 3rd > party tooling needs to catch up). > > One thing that the PEG parser makes possible in

[Python-ideas] Re: Bringing the print statement back

2020-10-23 Thread Paul Moore
On Fri, 23 Oct 2020 at 06:59, Henk-Jaap Wagenaar wrote: > > On Fri, 23 Oct 2020 at 06:35, Random832 wrote: >> >> Does anyone else remember when xkcd first mentioned python? The main selling >> point it had for it [and the one that was actually literally true, vs >> 'import antigravity' which

[Python-ideas] Re: Bringing the print statement back

2020-10-22 Thread Henk-Jaap Wagenaar
On Fri, 23 Oct 2020 at 06:35, Random832 wrote: > Does anyone else remember when xkcd first mentioned python? The main > selling point it had for it [and the one that was actually literally true, > vs 'import antigravity' which was a semi-satirical bit about the > batteries-included philosophy]

[Python-ideas] Re: Bringing the print statement back

2020-10-22 Thread Random832
On Mon, Oct 19, 2020, at 22:41, James T Moon wrote: > tl;dr *boo* *hiss* > > I can only imagine the new Python programmer's look of confusion, > turning to disgust, turning to giving up. Ten years from now, hopefully, Python 2 will be a distant memory, and Python 3.8 will be, at the very

[Python-ideas] Re: Bringing the print statement back

2020-10-21 Thread Andrew Svetlov
Agree with Serhiy. IIRC Ruby allows skipping brackets for a function call, this is very confusing sometimes On Tue, Oct 20, 2020, 18:54 Antal Gábor wrote: > Couldn't agree more. > > On 2020. 10. 20. 16:43, Serhiy Storchaka wrote: > > 20.10.20 12:54, J. Pic пише: > >> At the same time, Guido

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Antal Gábor
Couldn't agree more. On 2020. 10. 20. 16:43, Serhiy Storchaka wrote: 20.10.20 12:54, J. Pic пише: At the same time, Guido says he can remove that cost for no extra cost, so there's that: how do we find a good reason to not remove a cost for free ? Sounds like a win/win situation, both for most

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Serhiy Storchaka
20.10.20 12:54, J. Pic пише: > At the same time, Guido says he can remove that cost for no extra > cost, so there's that: how do we find a good reason to not remove a > cost for free ? Sounds like a win/win situation, both for most users > and for the new pegparser. It may have closer to zero

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread James T Moon
tl;dr *boo* *hiss* I can only imagine the new Python programmer's look of confusion, turning to disgust, turning to giving up. """ Whatever you do, don't write 'print space object', that's old Python 2. ... oh but, except waitasec, but if you're using Python 3.10 or greater then you can use

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Michael Smith
On Tue, Oct 20, 2020 at 06:02 J. Pic wrote: > Well personally I don't need print at all, I just read code and > imagine the output in my head and that's perfectly fine for me (I > don't even need a tty). > > Nonetheless, I believe the majority of Python users are not > necessarily familiar with

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread J. Pic
Well personally I don't need print at all, I just read code and imagine the output in my head and that's perfectly fine for me (I don't even need a tty). Nonetheless, I believe the majority of Python users are not necessarily familiar with PDB and would be using print as their main debugging

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Rob Cliffe via Python-ideas
No, the proposal was to keep print a function, but to allow alternative syntax without brackets (that would still call it as a function). Best wishes Rob Cliffe On 20/10/2020 05:38, Paul Bryan wrote: printis now a function, and as such can be passed to something that expects a callable. We

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Paul Bryan
Yeah, I should have done that instead of replying without context. 臘 On Tue, 2020-10-20 at 17:43 +1100, Chris Angelico wrote: > On Tue, Oct 20, 2020 at 3:47 PM Paul Bryan wrote: > > > > print is now a function, and as such can be passed to something > > that expects a callable. We would lose

[Python-ideas] Re: Bringing the print statement back

2020-10-20 Thread Chris Angelico
On Tue, Oct 20, 2020 at 3:47 PM Paul Bryan wrote: > > print is now a function, and as such can be passed to something that expects > a callable. We would lose this if it were restored to a statement. > Consequently this would be a breaking change, so I don't see it happening. > Did you read

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread Steven D'Aprano
On Tue, Oct 20, 2020 at 01:29:42PM +0900, Stephen J. Turnbull wrote: > Michael Smith writes: > > > On the other hand, assert has no parentheses, and gets committed for > > posterity everywhere. > > ISTR that assert was not converted to a function along with print > because it's a control flow

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread Paul Bryan
print is now a function, and as such can be passed to something that expects a callable. We would lose this if it were restored to a statement. Consequently this would be a breaking change, so I don't see it happening. On Tue, 2020-10-20 at 01:21 +0200, J. Pic wrote: > +1 because print is a

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread Stephen J. Turnbull
J. Pic writes: > +1 because print is a debugging tool mostly used in short lived > temporary code as such the parenthesis do not matter and do not > provide any value. Sez you. In *my* "business process automation" (I'm a professor), its primary use is for normal output. In debugging such

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread Stephen J. Turnbull
Michael Smith writes: > On the other hand, assert has no parentheses, and gets committed for > posterity everywhere. ISTR that assert was not converted to a function along with print because it's a control flow construct. ___ Python-ideas mailing

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread Michael Smith
On Mon, Oct 19, 2020 at 19:28 J. Pic wrote: > +1 because print is a debugging tool mostly used in short lived > temporary code as such the parenthesis do not matter and do not > provide any value. A lot of debugger use print to instrumentalize their code during > development or debugging, as

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread J. Pic
ERRATA : s/A lot of debuggers/A lot of developers/ (sorry I think I squinted) ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: Bringing the print statement back

2020-10-19 Thread J. Pic
+1 because print is a debugging tool mostly used in short lived temporary code as such the parenthesis do not matter and do not provide any value. A lot of debugger use print to instrumentalize their code during development or debugging, as in: "I want to dump some variable and run my test again"

[Python-ideas] Re: Bringing the print statement back

2020-07-18 Thread Stefano Borini
-1 because it will introduce potential ambiguities and will generate stylistic battles between developers. It will also add questions when teaching python, having to explain the potentially different syntax one might find around. On Wed, 10 Jun 2020 at 01:07, Guido van Rossum wrote: > > In

[Python-ideas] Re: Bringing the print statement back

2020-06-27 Thread redradist
Guido van Rossum wrote: > In Python 3.10 we will no longer be burdened by the old parser (though 3rd > party tooling needs to catch up). > One thing that the PEG parser makes possible in about 20 lines of code is > something not entirely different from the old print statement. I have a >

[Python-ideas] Re: Bringing the print statement back

2020-06-15 Thread Rob Cliffe via Python-ideas
On 12/06/2020 00:17, MRAB wrote: On 2020-06-11 22:15, Ethan Furman wrote: On 06/11/2020 01:18 PM, Rob Cliffe via Python-ideas wrote: If the new super-duper all-singing-and-dancing-and-make-the-tea parser can cope with 'print' without parens, it can cope with print followed by nothing. Good

[Python-ideas] Re: Bringing the print statement back

2020-06-14 Thread Stephen J. Turnbull
Greg Ewing writes: > If the latter, I can imagine some creative abuses as people > contrive for their favourite function of the moment to be called > 'print' so that they can call it without parens... +1 on creative abuse! At least in David Beazley lectures. ;-)

[Python-ideas] Re: Bringing the print statement back

2020-06-13 Thread Antoine Pitrou
Can I just write "boo, hiss"? In any case, even if those may be made unambiguous for the current parser (I have no idea if that's true), they're visually ambiguous for a human reader. With parentheses, it's immediate what are function calls. Without, it's far less obvious whether such calls

[Python-ideas] Re: Bringing the print statement back

2020-06-13 Thread João Bernardo
> > >>> print (1, 2, 3) > 1 2 3 > The only real advantage of print being a keyword (exec too, which had tons of benefits such adding stuff to local scope) was the fact of it actually being a keyword and not a gimmick to call functions without parentheses. So this is the worst of 2 worlds. Not a

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread MRAB
On 2020-06-11 22:15, Ethan Furman wrote: On 06/11/2020 01:18 PM, Rob Cliffe via Python-ideas wrote: If the new super-duper all-singing-and-dancing-and-make-the-tea parser can cope with 'print' without parens, it can cope with print followed by nothing. Good addition to the proposal,

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Ethan Furman
On 06/11/2020 01:18 PM, Rob Cliffe via Python-ideas wrote: If the new super-duper all-singing-and-dancing-and-make-the-tea parser can cope with 'print' without parens, it can cope with print followed by nothing. Good addition to the proposal, actually. :-) (Repeated for clarity: I'm in favour

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Rob Cliffe via Python-ideas
On 11/06/2020 16:45, Steven D'Aprano wrote: On Wed, Jun 10, 2020 at 08:00:26PM -0400, Jonathan Crall wrote: I wouldn't mind if this *only *worked for the specific characters "print". I would. What's so special about print? It's just a function. I use `iter` much more than print. Should we

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Jonathan Crall
> What's so special about print? It's just a function. I'd argue it's a pretty special function given its history. Just because it's used less frequently that something else doesn't mean it's not "special" in some sense. `iter x` never worked, whereas `print x` used to work, which is the only

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Calvin Spealman
On Tue, Jun 9, 2020 at 8:11 PM Guido van Rossum wrote: > In Python 3.10 we will no longer be burdened by the old parser (though 3rd > party tooling needs to catch up). > > One thing that the PEG parser makes possible in about 20 lines of code is > something not entirely different from the old

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Steven D'Aprano
On Wed, Jun 10, 2020 at 08:00:26PM -0400, Jonathan Crall wrote: > I wouldn't mind if this *only *worked for the specific characters "print". I would. What's so special about print? It's just a function. I use `iter` much more than print. Should we make a special exception for only 'iter' too?

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Steve Barnes
preference. There are other benefits as well. So I would suggest simply pip install ipython and type one extra letter when starting your python REPL. Steve Barnes -Original Message- From: Greg Ewing Sent: 11 June 2020 07:51 To: python-ideas@python.org Subject: [Python-ideas] Re: Bringing

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Greg Ewing
On 11/06/20 2:08 pm, Jonathan Goble wrote: +1 for the limited idea of bringing back the print statement with positional arguments only, as syntactic sugar (and not a replacement) for the print function Would that apply only to the actual built-in print function, or would it work for any

[Python-ideas] Re: Bringing the print statement back

2020-06-11 Thread Greg Ewing
I seem to remember reading somewhere that some very early Lisp systems had a REPL that allowed you to omit the parentheses around a top-level call. But that feature seems to have sunk without trace in the swamps of history. I can't see a good reason for Python to refloat it. -- Greg

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread David Mertz
On Wed, Jun 10, 2020, 8:04 PM Jonathan Crall wrote: > I wouldn't mind if this *only *worked for the specific characters > "print". > I often swap out 'print' for 'pprint', depending on the presentation I'm assuming for. Obviously, I need a 'from pprint import pprint' earlier. It "just works"

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Jonathan Goble
After thinking about it for a day, my opinions are: +1 for the limited idea of bringing back the print statement with positional arguments only, as syntactic sugar (and not a replacement) for the print function +0 on a print statement with keyword arguments (again, as syntactic sugar) -1 on

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Dan Sommers
On Wednesday, June 10, 2020, at 19:14 -0500, Chris Angelico wrote: On Wed, Jun 10, 2020 at 10:08 AM Guido van Rossum wrote: One thing that the PEG parser makes possible in about 20 lines of code is something not entirely different from the old print statement. I have a prototype: Python

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Chris Angelico
On Wed, Jun 10, 2020 at 10:08 AM Guido van Rossum wrote: > One thing that the PEG parser makes possible in about 20 lines of code is > something not entirely different from the old print statement. I have a > prototype: > > Python 3.10.0a0 (heads/print-statement-dirty:5ed19fcc1a, Jun 9 2020,

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Jonathan Crall
I wouldn't mind if this *only *worked for the specific characters "print". However, I think that allowing developers to call complex methods without parentheses will lead to very difficult to read code.I think that surrounding arguments with non-whitespace buffer characters is important for

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Neil Girdhar
Nevertheless, it's nice to see how powerful the new parser is! Any chance this would allow us to have a multi-line with statement? with self.context_manager_one(some, parameters, that, are, passed) \ as return_value_one, \ self.context_manager_two(self.p, slice(None),

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Guido van Rossum
On Tue, Jun 9, 2020 at 6:33 PM Greg Ewing wrote: > Why is this being proposed? > > I think we would need a very strong reason to consider this, > and so far I haven't seen any justification other than "because > we can". > There was definitely something of that... I was looking at the new PEG

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Brandt Bucher
Eh, I find that readability suffers in most of the examples shown. Let's save this for custom infix operators or something. That seems like a much more interesting discussion to me. ___ Python-ideas mailing list -- python-ideas@python.org To

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Derrick Joseph via Python-ideas
Hi, Just curious, why would bringing back Python 2’s print statement be a good idea? Warm Regards, Sadhana Srinivasan On Wed, Jun 10, 2020 at 2:39 AM, Jonathan Goble wrote: > On Tue, Jun 9, 2020 at 8:08 PM Guido van Rossum wrote: > >> I believe there are some other languages that support a

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Rhodri James
On 10/06/2020 01:06, Guido van Rossum wrote: print 2+2 4 print "hello world" hello world Bearing in mind that I'm a reactionary old curmudgeon who hates change, this gets a tepid -0.5 from me. It put me in mind of Tcl. Now I don't use Tcl a lot, and mostly that's in convoluted

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Paul Moore
On Wed, 10 Jun 2020 at 08:30, Steven D'Aprano wrote: > Given Python's execution model where we have statements and functions, I > think that it is a feature that they have different syntax. If I see > words separated by spaces: > > import math > del spam > while condition > if obj

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Serhiy Storchaka
10.06.20 03:06, Guido van Rossum пише: No, it's not April 1st. I am seriously proposing this (but I'll withdraw it if the response is a resounding "boo, hiss"). Well you have my "boo, hiss". I like programming languages which have such feature, but they have it from start, it is an integral

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Steven D'Aprano
On Tue, Jun 09, 2020 at 05:06:37PM -0700, Guido van Rossum wrote: > But wait, there's more! The same syntax will make it possible to call *any* > function: > > >>> len "abc" > 3 As you point out later on, there are issues with zero-argument calls and calls where the first argument starts with

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Greg Ewing
On 10/06/20 1:56 pm, Ricky Teachey wrote: I have a question. Is there a very good reason that the language allows spaces between function names and the parentheses? >>> print           (1,2,3) Python, in common with many other languages, allows whitespace between any pair of lexical tokens.

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Stephen J. Turnbull
Gregory P. Smith writes: > I love that the new parser allows us to even explore these > possibilities. We should be very cautious about what syntax > changes we actually adopt. Meter needle wrapped around pin at +1 (twice! :-) BTW: > We aren't Perl, Ruby, Rexx, Lua, Tcl, ... This made me

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread David Mertz
I think I have almost the same feeling as Naomi and Gregory. After 10+ years of print statement being an error, typing it as one remains my SECOND most common syntax error. My FIRST most common is omitting the colon that introduces blocks... Which we also don't actually need. I've made that

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Ricky Teachey
I have a question. Is there a very good reason that the language allows spaces between function names and the parentheses? >>> print (1,2,3) 1 2 3 Does *anybody* specifically make use of this...? Perhaps I am missing something obvious. Anyway if this were changed so that this kind of

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Jonathan Goble
On Tue, Jun 9, 2020, 9:33 PM Edwin Zimmerman wrote: > On 6/9/2020 9:21 PM, Jonathan Goble wrote: > > On Tue, Jun 9, 2020, 8:47 PM Edwin Zimmerman > wrote: > >> Wouldn't this break backwards compatibility with everything the whole way >> back to 3.0? I fear a future with where I have to run a

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Edwin Zimmerman
On 6/9/2020 9:21 PM, Jonathan Goble wrote: > On Tue, Jun 9, 2020, 8:47 PM Edwin Zimmerman > wrote: > > Wouldn't this break backwards compatibility with everything the whole way > back to 3.0?  I fear a future with where I have to run a 2to3 type tool on >

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Greg Ewing
Why is this being proposed? I think we would need a very strong reason to consider this, and so far I haven't seen any justification other than "because we can". -- Greg ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Gregory P. Smith
On Tue, Jun 9, 2020 at 5:49 PM Naomi Ceder wrote: > FWIW... > > As someone who has spent at least the last 5 years trying (unsuccessfully) > to reprogram 15 years of muscle memory of print as a statement, I vote +1 > to print without parens. > > As someone who teaches Python and groans at

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Jonathan Goble
On Tue, Jun 9, 2020, 8:47 PM Edwin Zimmerman wrote: > Wouldn't this break backwards compatibility with everything the whole way > back to 3.0? I fear a future with where I have to run a 2to3 type tool on > third-party dependencies just to get them to work with my 3.7 code base. > My

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Naomi Ceder
FWIW... As someone who has spent at least the last 5 years trying (unsuccessfully) to reprogram 15 years of muscle memory of print as a statement, I vote +1 to print without parens. As someone who teaches Python and groans at explaining exceptions, I'm -0 on print without parens and -1 on other

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Edwin Zimmerman
Wouldn't this break backwards compatibility with everything the whole way back to 3.0?  I fear a future with where I have to run a 2to3 type tool on third-party dependencies just to get them to work with my 3.7 code base. --Edwin On 6/9/2020 8:06 PM, Guido van Rossum wrote: > In Python 3.10 we

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Bernardo Sulzbach
If f and g are unary functions, f g 0 is evaluated as f(g(0))? Asking because you didn't mention composition. That is, could we have `print "hello", input "Name:"` instead of `print "hello", input("Name:")`? Overall, I am against this because I like the "explicitness" of using parenthesis for

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Jonathan Goble
On Tue, Jun 9, 2020 at 8:08 PM Guido van Rossum wrote: > I believe there are some other languages that support a similar grammar > (Ruby? R? Raku?) but I haven't investigated. > Lua has a similar feature: a name (including a dotted name or index[ing], which are identical in Lua) immediately

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Matthias Bussonnier
Hi Guido, Excited about the possibilities of the new PEG parser ! Have there been any consideration to allow this new call syntax to actually quote the expression given as parameter ? Or have a different meaning than a normal call ? In IPython/Jupyter we use the fact that this is not valid

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Ethan Furman
On 06/09/2020 05:06 PM, Guido van Rossum wrote: One thing that the PEG parser makes possible in about 20 lines of code is something not entirely different from the old print statement. I have a prototype: >>> print 2+2 4 >>> print "hello world" hello world There are downsides too, though.