[Python-ideas] Desperate need for enhanced print function

Ryan Gonzalez rymg19 at gmail.com
Sat Sep 5 21:39:35 CEST 2015



On September 5, 2015 2:33:00 PM CDT, Anand Krishnakumar <anandkrishnakumar123 at gmail.com> wrote:
>Hi!
>
>This is my first time I'm sending an email to the python-ideas mailing
>list. I've got an enhancement idea for the built-in print function and
>I
>hope it is as good as I think it is.
>
>Imagine you have a trial.py file like this:
>
>a = 4
>b = "Anand"
>
>print("Hello, I am " + b + ". My favorite number is " + str(a) + ".")
>OR
>print("Hello, I am ", b, ". My favorite number is ", a, ".")
>
>Well I've got an idea for a function named "print_easy" (The only valid
>name I could come up with right now).
>
>So print_easy will be a function which will be used like this (instead
>of
>the current print statement in trial.py) :
>
>print_easy("Hello, I am", b, ". My favorite number is", a ".")

I'm sorry...but I can't see the difference. Aren't the two calls exactly the same??

>
>Which gives out:
>
>Hello, I am Anand. My favorite number is 4
>
>The work it does is that it casts the variables and it also formats the
>sentences it is provided with. It is exclusively for beginners.
>
>I'm 14 and I came up with this idea after seeing my fellow classmates
>at
>school struggling to do something like this with the standard print
>statement.
>Sure, you can use the format method but won't that be a bit too much
>for
>beginners? (Also, casting is inevitable in every programmer's career)
>
>Please let me know how this sounds. If it gains some traction, I'll
>work on
>it a bit more and clearly list out the features.
>
>Thanks,
>Anand.

-- 
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.


More information about the Python-ideas mailing list