A proposal to rename the term "duck typing"

After sending this proposal to the Python list, it was suggested that I redirect it here ("recommended" likely being to strong a word). We have a term in our lexicon "duck typing" that traces its origins, in part to a quote along the lines of "If it walks like a duck, and talks like a duck, ..." But I would assert that it would be far more Pythonic to use this quote instead: BEDEMIR: How do you know she is a witch? VILLAGER #1: She looks like one. In that case, it would be far more appropriate for use to call this sort of type analysis "witch typing" For additional supporting evidence: WITCH: I'm not a witch. I'm not a witch. BEDEMIR: But you are dressed as one. WITCH: They dressed me up like this. CROWD: No, we didn't -- no. WITCH: And this isn't my nose, it's a false one. BEDEMIR: Well? VILLAGER #1: Well, we did do the nose. BEDEMIR: The nose? VILLAGER #1: And the hat -- but she is a witch! The listed operations very much resemble how one defines an iterator in Python. One can take any object add imply add two methods, named __iter__ and __next__ and (voila!), you now have an iterator. And it is known to be such because of these methods. Now, to be intellectually honest, I must acknowledge a very cogent opposing argument from a Mr. Cameron Simpson in Australia, who pointed out that the true identification of a which was not based on these superficial appearances, but instead based on the weight of a duck -- which of course, is very strongly suggestive that "duck typing" is appropriate. After recovering from the confusion that I suffered from him having a name other than "Bruce", I tried to consider more fully the logic of his argument. It seems that the test here is as follows: VILLAGER #1: If... she.. weighs the same as a duck, she's made of wood. BEDEMIR: And therefore--? VILLAGER #1: A witch! Now, "duck typing" strictly applied would seem to me that weighing the same as a duck would imply that she was a duck. This is not explicitly stated in the source material -- but if that was the implicit understanding, then we would have "is-a" relationships relating ducks to wooden things to witches. It's here that I admittedly get a bit befuddled. If being a duck is sufficient evidence of witchcraft, we would be saying that all ducks are witches. On the other hand, if we are to use this test universally, then that sounds like all witches are ducks. I do not have enough samples to fully determine whether the set of witches and the set of ducks are identical sets, but I would be intended to think otherwise, especially if we furthermore have to consider the equivalence with the set of things made of wood. I think I might find it far simpler to accept the villagers' initial intuitions about the type-inferences rules for witches. I certainly would not want to have to set up a three-layer class hierarchy any time I wished to do dynamic type inference, so I'll just go back to the initial question. It was not whether the woman was a duck, but whether she was a witch. Hence, I believe a more Pythonic name for this sort of type inference should be "witch typing" Roger Christman Electrical Engineering and Computer Science Pennsylvania State University

On 8/28/2016 12:24 PM, ROGER GRAYDON CHRISTMAN wrote:
After sending this proposal
to replace 'duck typing' with 'witch typing'
to the Python list,
where it was mostly viewed as a joke
it was suggested that I redirect it here
by Mark Lawrence, who likes to joke also. I recommend that people not waste time on this. -- Terry Jan Reedy

On Sunday, August 28, 2016, ROGER GRAYDON CHRISTMAN <dvl@psu.edu> wrote:
I believe the duck is out of the bag on this one. First the "duck test" that you quote above is over 100 years old. https://en.m.wikipedia.org/wiki/Duck_test So that's entrenched. Second this isn't a Python-only term anymore and language is notoriously hard to change prescriptively. Third I think the duck test is more appropriate than the witch test which involves the testers faking the results. --- Bruce -- --- Bruce Check out my puzzle book and get it free here: http://J.mp/ingToConclusionsFree (available on iOS)

On Sun, Aug 28, 2016 at 7:41 PM, Bruce Leban <bruce@leban.us> wrote:
Agreed. It's also fairly problematic given that you're deriving the term from a sketch about witch hunts. While the Monty Python sketch is hilarious and, it's the ignorant mob that's the butt of the joke rather than the "witch", this joke doesn't necessarily play well universally, especially given that there places today where women are being killed for being "witches". Best, Erik

On 8/28/2016 12:24 PM, ROGER GRAYDON CHRISTMAN wrote:
After sending this proposal
to replace 'duck typing' with 'witch typing'
to the Python list,
where it was mostly viewed as a joke
it was suggested that I redirect it here
by Mark Lawrence, who likes to joke also. I recommend that people not waste time on this. -- Terry Jan Reedy

On Sunday, August 28, 2016, ROGER GRAYDON CHRISTMAN <dvl@psu.edu> wrote:
I believe the duck is out of the bag on this one. First the "duck test" that you quote above is over 100 years old. https://en.m.wikipedia.org/wiki/Duck_test So that's entrenched. Second this isn't a Python-only term anymore and language is notoriously hard to change prescriptively. Third I think the duck test is more appropriate than the witch test which involves the testers faking the results. --- Bruce -- --- Bruce Check out my puzzle book and get it free here: http://J.mp/ingToConclusionsFree (available on iOS)

On Sun, Aug 28, 2016 at 7:41 PM, Bruce Leban <bruce@leban.us> wrote:
Agreed. It's also fairly problematic given that you're deriving the term from a sketch about witch hunts. While the Monty Python sketch is hilarious and, it's the ignorant mob that's the butt of the joke rather than the "witch", this joke doesn't necessarily play well universally, especially given that there places today where women are being killed for being "witches". Best, Erik
participants (4)
-
Bruce Leban
-
Erik Bray
-
ROGER GRAYDON CHRISTMAN
-
Terry Reedy