On Thu, Mar 15, 2018 at 12:15:52AM +1100, Steven D'Aprano <[email protected]>
wrote:
> On Wed, Mar 14, 2018 at 09:18:30AM -0300, Facundo Batista wrote:
> > We should write the following, instead:
> >
> > long_string = (
> > "some part of the string " +
> > "with more words, actually is the same " +
> > "string that the compiler puts together")
>
> Should we? I disagree.
>
> Of course you're welcome to specify that in your own style-guide for
> your own code, but I won't be following that recommendation.
>
>
> > I know that "no change to Python itself" is needed, but having a
> > formal discouragement of the idiom will help in avoiding people to
> > fall in mistakes like:
> >
> > fruits = {
> > "apple",
> > "orange"
> > "banana",
> > "melon",
> > }
>
> People can make all sorts of mistakes through carlessness. I wrote
>
> {y, x*3}
>
> the other day instead of {y: x**3}. (That's *two* errors in one simple
> expression. I wish I could say it was a record for me.) Should we
> "discourage" exponentiation and dict displays and insist on writing
> dict((y, x*x*x)) to avoid the risk of errors? I don't think so.
We should fix what causes real problems, not convoluted ones. And
this particular misfeature caused problems for me.
> --
> Steve
Oleg.
--
Oleg Broytman http://phdru.name/ [email protected]
Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/