Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Anders Hovmöller
> Summary: Michael Selik has produced a nice refactoring of an example. > I suggest further refactoring, to create a function decorator that > does the job. This might be useful if the example is an instance of a > common use pattern. It seems to me this discussion has drifted away from the

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Jonathan Fine
Summary: Michael Selik has produced a nice refactoring of an example. I suggest further refactoring, to create a function decorator that does the job. This might be useful if the example is an instance of a common use pattern. Michael Selik wrote > def open(file, mode='r', buffering=-1,

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Oleg Broytman
On Thu, Sep 13, 2018 at 09:36:42AM +0100, Samantha Quan wrote: >First, I'd like to express how grateful I am to see more and more >technical communities embrace diversity and inclusivity, particularly big >tech communities like Python, Redis, and Django. >In the spirit of the big

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread David Mertz
Some books we should burn include: Title Beautiful Evidence Author Edward R. Tufte Edition illustrated Publisher Graphics Press, 2006 ISBN 1930824165, 9781930824164 Length 213 pages Title Beautiful Code:

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Jacco van Dorp
-1. The concept of ugly code is everywhere on the internet. Everyone on this planet has either written ugly code or no code at all. Some have also written beautiful code. People aren't code, and code isn't people. I can't see this becoming a problem until we have an AI that can feel insulted

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
On Thu, 13 Sep 2018 11:55:40 +0200 "Giampaolo Rodola'" wrote: > > This is simply ridiculous. I'm not sure if this is political > correctness pushed to its limits or just trolling. Indeed she might be trolling. Though the fact we're hesitating on the diagnosis shows how far reality has come on

Re: [Python-ideas] __iter__(), keys(), and the mapping protocol

2018-09-13 Thread Jonathan Fine
Someone wrote: Granted, my only strong argument is that the ** unpacking operator depends on this method to do its job, and it's currently alone amongst Python's operators in depending on a non-dunder to do so I like this argument. And I think it's important. Here's some background

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Stephan Houben
Op do 13 sep. 2018 12:03 schreef Antoine Pitrou : > On Thu, 13 Sep 2018 11:55:40 +0200 > "Giampaolo Rodola'" > wrote: > > > > This is simply ridiculous. I'm not sure if this is political > > correctness pushed to its limits or just trolling. > > Indeed she might be trolling. Though the fact

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Jacco van Dorp
> I'm pleasantly surprised by the general response here. I was taking it > seriously because, well, that's how far it's going everywhere. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
Hi Samantha, You ask others to be open-minded, but fail to show such an attitude yourself. Beauty is a very old and important concept in the history of human societies, present in most or all of them, and has been the subject of a wide range of interpretations, studies and theories. And, as a

Re: [Python-ideas] __iter__(), keys(), and the mapping protocol

2018-09-13 Thread Brice Parent
Le 13/09/2018 à 10:07, Jonathan Fine a écrit : Now for my opinions. (Yours might be different.) First, it is my opinion that it is not reasonable to insist that the argument after ** must be a mapping. All that is required to construct a dictionary is a sequence of (key, value) pairs. The

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Jonathan Fine
The first line from "import this" is The Zen of Python, by Tim Peters I suggest we put this discussion on hold, until Tim Peters (copied) has had a chance to respond. -- Jonathan ___ Python-ideas mailing list Python-ideas@python.org

[Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Samantha Quan
First, I'd like to express how grateful I am to see more and more technical communities embrace diversity and inclusivity, particularly big tech communities like Python, Redis, and Django.In the spirit of the big recent terminology change, I propose retiring or rewording the "Beautiful is better

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Giampaolo Rodola'
On Thu, Sep 13, 2018 at 10:38 AM Samantha Quan wrote: > > First, I'd like to express how grateful I am to see more and more technical > communities embrace diversity and inclusivity, particularly big tech > communities like Python, Redis, and Django. > > In the spirit of the big recent

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Oleg Broytman
On Thu, Sep 13, 2018 at 11:05:53AM +0200, Jacco van Dorp wrote: > -1. The concept of ugly code is everywhere on the internet. Everyone on > this planet has either written ugly code or no code at all. Some have also > written beautiful code. > > People aren't code, and code isn't people. I can't

Re: [Python-ideas] __iter__(), keys(), and the mapping protocol

2018-09-13 Thread Jonathan Fine
Hi Brice Good comment. I liked it. Not badly off-topic I think, because it looks to be an interesting work-around for the original problem. You wrote > But for dataclasses, I'd find it quite useful to have > {**my_data_class} > be a shortcut to > {**dataclasses.asdict(my_data_class)} How about

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread João Santos
One important difference between master/slave and beautiful/ugly is that the first pair are concrete concepts that typically applies to people, and the second are abstract concepts that always applied also to objects and abstract concepts. On Thu, 13 Sep 2018 at 13:16, Antoine Pitrou wrote:

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Chris Angelico
On Thu, Sep 13, 2018 at 10:16 PM, João Santos wrote: > One important difference between master/slave and beautiful/ugly is that the > first pair are concrete concepts that typically applies to people, and the > second are abstract concepts that always applied also to objects and > abstract

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Jacco van Dorp
Op do 13 sep. 2018 om 14:22 schreef Chris Angelico : > On Thu, Sep 13, 2018 at 10:16 PM, João Santos wrote: > > One important difference between master/slave and beautiful/ugly is that > the > > first pair are concrete concepts that typically applies to people, and > the > > second are abstract

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
On Thu, 13 Sep 2018 12:32:43 +0200 Oleg Broytman wrote: > On Thu, Sep 13, 2018 at 12:22:14PM +0200, Jacco van Dorp > wrote: > > I'm pleasantly surprised by the general response here. I was taking it > > seriously because, well, that's how far it's going everywhere. > > 1. I couldn't believe

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread M.-A. Lemburg
I just want to add my -1 to the list of others who have already expressed similar opinions. Please keep the meaning of language associated with the respective context. Language is always open to interpretation. It doesn't imply that one particular interpretation is more right or more wrong, nor

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Calvin Spealman
Samantha, I came into this thread reading the subject and thinking "over my dead body!" until I read your well-thought reasoning and gave even a little bit of thought to the idea. You're absolutely right and while I think its very unlikely to get enough support I do think it is a very good

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Rhodri James
On 13/09/18 14:16, Calvin Spealman wrote: Samantha, I came into this thread reading the subject and thinking "over my dead body!" until I read your well-thought reasoning and gave even a little bit of thought to the idea. You're absolutely right and while I think its very unlikely to get

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread João Santos
That's why I focused on pairs. I understand why some people might feel offended by the term slave (and master in opposition to it), despite personally feeling the concepts are detached. I never saw anyone oppose using the terms master/copy. Trying to tie something as abstract and general as

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
On Thu, 13 Sep 2018 09:16:17 -0400 Calvin Spealman wrote: > > I came into this thread reading the subject and thinking "over my dead > body!" until I read your well-thought reasoning and gave even a little bit > of thought to the idea. > > You're absolutely right and while I think its very

[Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Giampaolo Rodola'
On Thu, Sep 13, 2018 at 12:51 PM Oleg Broytman wrote: > 2. I was sure it was trolling on the trail of >https://bugs.python.org/issue34605 Wow! I find it a bit excessive that #34605 was not discussed first and got checked in so quickly. I hope there won't be similar initiatives about terms

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Guido van Rossum
Everyone who still wants to reply to this thread: please decide for yourself whether the OP, "Samantha Quan" who started it could be a Russian troll. Facts to consider: (a) the OP's address is ...@yandex.com, a well-known Russian website (similar to Google); (b) there's a Canadian actress named

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Jonathan Fine
Hi Anders and Michael I think it would be great if plugging existing functions into our code was as easy as, well, plugging an electrical appliance into a wall socket. However, even this ease of use has taken time. https://en.wikipedia.org/wiki/AC_power_plugs_and_sockets#History And

Re: [Python-ideas] Pre-conditions and post-conditions

2018-09-13 Thread Marko Ristin-Kaufmann
Hi, A brief follow-up (latest version 1.5.3): I removed the dependency on meta package so that now all comprehensions and generator expressions work. I still had to depend on asttokens in order to get the source code of the condition function. Is there maybe an alternative solution which uses only

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Richard Mateosian
Body shaming is bad. Don't call people "ugly," regardless of how they look. Code shaming, on the other hand, can be productive. Nothing wrong with calling ugly code ugly. ...RM On Thu, Sep 13, 2018 at 1:38 AM Samantha Quan wrote: You can't argue that the word "ugly" is harmless, now that

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Michael Selik
On Thu, Sep 13, 2018 at 11:35 AM Anders Hovmöller wrote: > Using keyword arguments is not painful. It's ugly in some unusual cases, > such as creating helper functions with nearly the same signature. > > It’s more painful than positional. To me the fact that everyone who works > on code bases

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Samantha Quan
Of course, the argument wasn't that we should treat "good" and "bad" code equally (speaking of common tactics -- "straw man"). The point was that the words you use can make a huge difference. "Ugly" is very obviously a slur. It carries a dark meaning *and* it's still being actively used towards

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Tim Delaney
On Fri, 14 Sep 2018 at 08:48, Greg Ewing wrote: > M.-A. Lemburg wrote: > > For > > me, it refers to a general feeling of consistency, pureness and > > standing out on its own. It's abstract and doesn't have > > anything to do with humans. > > Yep. And the proposed replacement "clean/dirty"

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Koos Zevenhoven
On Thu, Sep 13, 2018 at 8:33 PM Jonathan Fine wrote: > > > To be beautiful means to be yourself. You don't need > to be accepted by others. You need to accept yourself. > > I wonder if this is related to the beauty in "The Zen of Python". > > Different people may need different advice.

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Oleg Broytman
On Thu, Sep 13, 2018 at 09:06:53PM +0100, Samantha Quan wrote: >It's my understanding that master/slave terminology is now deprecated, >because these words carry dark meanings, too, and further alienate folks >who feel uncomfortable being reminded of them everywhere. That's the idea

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Greg Ewing
Jacco van Dorp wrote: You can have master and slave devices - for example, if I have a PC that tells a robot what to do, my PC is the master and the robot the slave. If we're going to object to "slave", we should object to "robot" as well, since it's derived from a Czech word meaning "forced

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Greg Ewing
M.-A. Lemburg wrote: For me, it refers to a general feeling of consistency, pureness and standing out on its own. It's abstract and doesn't have anything to do with humans. Yep. And the proposed replacement "clean/dirty" doesn't even mean the same thing. It's entirely possible for a thing to

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Terry Reedy
On 9/13/2018 7:34 PM, Tim Peters wrote: I already made clear that I'm opposed to changing it.\ To me, this settles the issues. As author, you own the copyright on your work. The CLA allows revision of contributions, but I don't think that contributed poetry should be treated the same as

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Anders Hovmöller
> "Ugly" is very obviously a slur. It carries a dark meaning *and* it's still > being actively used towards people. Honestly, I can't imagine someone > cheering up when they see that word, especially if they're self-conscious > about their appearance or were told they were "ugly" at some point

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Chris Angelico
On Fri, Sep 14, 2018 at 1:41 PM, Tim Peters wrote: > I presume "Zen" came to their mind because it's brief, and a critical > reading reveals a number of seeming ambiguities and contradictions, yet it > nevertheless _appears_ to say _something_ ;-) "Somehow it seems to fill my head with ideas -

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Ryan Birmingham
Discussions like this are always difficult and charged, but I think there's a good opportunity for growth here. I love being involved with the Python community for, among many other reasons, I think Python is quite inclusive, especially as a technical community. However, I know that people often

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Greg Ewing
Calvin Spealman wrote: I ask everyone on this thread being rude to please step back and try to look at the issue without your bias and knee-jerk reactions. I've given it some thought, and this is what I think: As has been pointed out, context is important. The reason that shunning people for

Re: [Python-ideas] Deprecation utilities for the warnings module

2018-09-13 Thread Ryan Gonzalez
I have to say, this would be amazing! I've basically had to create many of these by hand over time, and I doubt I'm the only person who's wondered how this isn't in the stdlib! On Thu, Sep 13, 2018, 7:18 PM Ilya Kulakov wrote: > (Apologies if it's a duplicate. I originally posted to >

[Python-ideas] Deprecation utilities for the warnings module

2018-09-13 Thread Ilya Kulakov
(Apologies if it's a duplicate. I originally posted to python-id...@googlegroups.com) I've been recently working on an internal library written entirely in Python. The library while being under development was as actively used by other teams. The product was under pressure and hasty design

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Anders Hovmöller
> On 13 Sep 2018, at 21:34, Michael Selik wrote: > > On Thu, Sep 13, 2018 at 11:35 AM Anders Hovmöller > wrote: >> Using keyword arguments is not painful. It's ugly in some unusual cases, >> such as creating helper functions with nearly the same signature. > >

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Michael Selik
On Thu, Sep 13, 2018 at 5:34 PM Anders Hovmöller wrote: > I wrote a script so you can get a list of [good use cases] in big code > bases without looking through the code randomly. > https://gist.github.com/boxed/e60e3e19967385dc2c7f0de483723502 > In that case, you should be able to link to a

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Anders Hovmöller
> On 14 Sep 2018, at 03:35, Michael Selik wrote: > > On Thu, Sep 13, 2018 at 5:34 PM Anders Hovmöller > wrote: > I wrote a script so you can get a list of [good use cases] in big code bases > without looking through the code randomly. >

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Michael Selik
On Thu, Sep 13, 2018 at 5:22 PM Anders Hovmöller wrote: > For example: > django-master/django/http/multipartparser.py 225 > Sorry, I didn't recognize this as a link on first read. I'll provide a link here to the code in context.

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Tim Peters
[Tim] > > > I already made clear that I'm opposed to changing it. > [Terry Reedy ] > To me, this settles the issues. As author, you own the copyright on > your work. The CLA allows revision of contributions, but I don't think > that contributed poetry should be treated the same as code and

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Michael Selik
On Thu, Sep 13, 2018 at 6:50 PM Anders Hovmöller wrote: > On 14 Sep 2018, at 03:35, Michael Selik wrote: > In that case, you should be able to link to a compelling example. If you > go to the trouble of finding one, I'll take time to try to refactor it. > > >

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Tim Peters
[Tim Delaney ] > "Elegant" is the *only* word I think it would be appropriate to replace > "beautiful" with. > And I can't think of an elegant replacement for "ugly" to pair with > "elegant". "Awkward" would probably be the best I can think of, and > "Elegant is better than awkward" just feels

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Anders Hovmöller
>> I’ll repeat myself: what about .format()? If you localize you can’t use >> f-strings. What about templates in web apps? Obviously f-strings won’t do. >> What about json blobs in REST APIs? Again no help from f-strings. What about >> functions with more than 3 arguments generally? > > For

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Michael Selik
On Thu, Sep 13, 2018, 12:39 AM Anders Hovmöller wrote: > It seems to me this discussion has drifted away from the original > discussion toward one where you have a chain of functions with the same or > almost the same signature. This is interesting for sure but we shouldn’t > forget about the

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Ryan Gonzalez
FWIW a big flag to me was putting an Urban Dictionary link under "references"... On Thu, Sep 13, 2018, 12:21 PM Anders Hovmöller wrote: > > > If I were to change anything, I'd drop the reference to "Zen". That > wasn't part of the original, and was added by someone else. If, e.g., a > Zen

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Nathaniel Smith
On Thu, Sep 13, 2018 at 9:13 AM, Mark E. Haase wrote: > On Thu, Sep 13, 2018 at 10:49 AM Rhodri James wrote: > >> More importantly, this whole idea of banning and/or changing terminology >> is psychologically and sociologically wrong-headed. The moment you say "You >> may not use that word" you

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Mikhail V
On Thu, Sep 13, 2018 at 11:39 AM Samantha Quan wrote: > > One alternative to that clause I could think of is "Clean is better than > dirty", > but please do speak up if you have better ideas. "Clean is better than hairy!" :-D > I ask you to give this change serious consideration, On a

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Mark E. Haase
On Thu, Sep 13, 2018 at 10:49 AM Rhodri James wrote: More importantly, this whole idea of banning and/or changing terminology is > psychologically and sociologically wrong-headed. The moment you say "You > may not use that word" you create a taboo, and give the word a power that > it did not

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Chris Angelico
On Fri, Sep 14, 2018 at 3:57 AM, Mikhail V wrote: > And I don't know what can be really 'beautiful' > in _any_ code. > Ugly - yes, it's often can be said about the code which is full of > redundant punctuation, bad formatting, etc. > But this sound strange: "this code is beautiful". Do people

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Anders Hovmöller
> If I were to change anything, I'd drop the reference to "Zen". That wasn't > part of the original, and was added by someone else. If, e.g., a Zen > Buddhist objected that this use trivializes their beliefs, I'd have real > sympathy with _that_. But I'd be greatly surprised if a Zen

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Jonathan Fine
The line in question is from Tim Peters' "The Zen of Python" Beautiful is better than . where at present is "ugly". My opinion, based on my present experience and knowledge, is that it is reasonable to consider asking Tim to change . Also, I suggest that in the context of Python and its

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Tim Peters
[Jonathan Fine ] > The first line from "import this" is > > The Zen of Python, by Tim Peters > > I suggest we put this discussion on hold, until Tim Peters (copied) > has had a chance to respond. > > Don't look at me - I was merely channeling Guido ;-) That said, "beautiful v. ugly" in

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Paul Moore
On Thu, 13 Sep 2018 at 17:15, Mark E. Haase wrote: > Let's assume her proposal was made in good faith. Certainly. I'm opposed to any proposal to change long-established and common usage wording on the basis that it has the *potential* to cause offense. If anyone is *actually* offended by the

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Jonathan Fine
Possibly off topic - but it is about beauty. Anders wrote > I just happen to be a Zen Buddhist! And you’re right. The worst reaction you > are likely to get is an eye roll. https://en.wikipedia.org/wiki/Thich_Naht_Hahn is a Zen Buddhist. He has said To be beautiful means to be yourself.

Re: [Python-ideas] Improving fn(arg=arg, name=name, wibble=wibble) code

2018-09-13 Thread Anders Hovmöller
> Using keyword arguments is not painful. It's ugly in some unusual cases, such > as creating helper functions with nearly the same signature. It’s more painful than positional. To me the fact that everyone who works on code bases that are of non-trivial size see positional arguments being