Pickles: Why are they called that? [closed]

北慕城南 提交于 2019-12-13 12:53:21

问题


I'm surprised this is such a hard answer for me to find.

It's such a strange name. Why are pickles called pickles?
http://en.wikipedia.org/wiki/Pickle_(Python)

I understand what "pickling" means with respect to vegetables and I understand that the python concept is analogous. But, why choose "pickle" instead of "serialization"? Is it an inside joke? Is there a history about it?


回答1:


From the verb to pickle:

vegetables, such as cauliflowers, onions, etc, preserved in vinegar, brine, etc

It is Python objects, preserved for later use. The name was taken from the Modula-3 concept, a language that inspired many Python features. Also see the Module-3 Pickle documentation.

I suspect Guido picked the name because:

  • it is better than the first name he thought of (flatten, see this old usenet post announcing it)
  • funny names are better than drab ones, in tradition with the Monty Python background of the language
  • there is a nice alliteration going on there with the P's (Python Pickles)
  • you put pickles (in jars) on a shelve, a module added to the library in the same commit.

If you ever get hold of Guido's time machine you could travel back to November 1994 and ask him yourself why he picked that specific name. I do notice that Ken Mannheimer already uses the term pickled objects a mere 10 days after the announcement of flatten as part of the follow-up discussion, probably referencing to the Modula-3 inspiration for the concept, and the name must've stuck.



来源:https://stackoverflow.com/questions/27324986/pickles-why-are-they-called-that

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!