(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=41322758

村上春树将生活中的艰辛或“痛苦”比作不可避免的经历,而轻松或舒适可以是可选的。 这种观点似乎特别能引起年轻观众的共鸣,他们欣赏他简单的写作风格,让人想起埃里克·克莱普顿等著名音乐家。 相比之下,作家马丁·艾米斯(Martin Amis)对文学中的陈词滥调发起了一场战争,但村上似乎拥抱了这些陈词滥调,从他直截了当的描述中可以看出,例如“我的腿疼得要疯了”,以及重复的关于天气很美的陈述,因为“没有 天空中的一朵云”。 提出的另一点是在以亲密关系的各个方面命名的编程库中使用明确的性参考,例如 AnAL、HUMP、Pölgygamy、Swingers、Adult Lib、Gspöt、Möan​​.lua、fluUIDs 和 yaoui。 这些名字引发了人们对科技界品味和适当性的质疑。

相关文章

原文


    >>> from __future__ import braces
      File "", line 1
    SyntaxError: not a chance
For those interested in how this (hilarious) error text came to be, it's been hardcoded in cpython since 2001!

https://github.com/python/cpython/commit/ad3d3f2f3f19833f59f...

The author, Jeremy Hylton, is now a Principal Engineer at Google working on AI search quality. It's quite remarkable that in 24 years, a single person's career has gone from a tongue-in-cheek memorialization of certain syntax being forbidden, to working on ubiquitous query systems that don't require dedicated syntax at all!



Reminds me of `break rust;` causing the Rust compiler to emit an internal compiler error. I wonder which other languages have similar easter eggs.



> The Stardate time format had nothing to do with Sun. I added it to Tcl while working at Scriptics, as an easter egg for the then-upcoming Tcl2K Conference. One of the conference events was a competition to implement a standard-to-stardate conversion utility, using an arcane formula. Only one guy entered the event. He spent a couple hours agonizing over the implementation (as he was looking for a job at Scriptics, he was eager to impress) only to have the easter egg revealed afterwards. Of course he won the competition anyway. And he got the job, too. – Eric Melski



> error: internal compiler error: It looks like you're trying to break rust; would you like some ICE?

Lovely, and the word game is just great.



How is it remarkable? Random people didn't get to add stuff to Python in 2001. It was a niche thing and someone who was contributing to it was likely to be a smart and dedicated person who would naturally have an impactful career ahead of them.

It's a misconception that the informal playful hobby hacking things are their separate world from real professional development.



> In 2024 suddenly everyone is grown up and corporate and has never done anything wrong.

Trying to be considerate of others, even when they are different from ourselves, is indeed kind and good and does come with maturity. You needn't be corporate or have never done wrong to be considerate.



I thought getting cute with import-hooks was probably the most creative possible way to get fired, but I see now that this was naive. My only regret is that the codec regex probably prevents using stuff like "μtf8" to really troll people properly, so now I'm going to have to use import hooks, preprocessors, and sys.settrace to monkey-patch every function to the previously called one, while swapping stdout and stderr every 17 minutes.



Part of me says that python has not gone out of its way to expose preprocessor hooks for good reason, and reasonable adults should stay away from it.

The other part wants nothing to do with reasonable adults anyhow. Such fun could be had.



Thank you for connecting 2 sayings of Murakami Haruki :)

1.痛みは避けがたいが、苦しみはオプショナル

(https://archive.ph/Ca9rE)

Now, I don’t know how representative this book is of Murakami’s novelistic style, but I wonder: Is this low-maintenance, attention-deficit prose part of Murakami’s attraction, especially among the young? Do people enjoy reading him for the same reason they persist in listening to music as blandly familiar as Clapton’s? If Martin Amis is engaged in a “war against cliché” — a phrase in danger of becoming a cliché itself — then Murakami, on the evidence of this book, is a serial appeaser. How much does his thigh hurt? “Like crazy.” How do we know the weather is nice? Because — as he tells us (twice) — there’s “not a cloud in the sky.”

  self-styled zero-percenter and book reviewer in the above 
2.^_^?

(Norwegian Wood)

(Roughly, “growth is pain, nongrowth is unfortunate”)



Beautiful song… I start to see where the … uh … tradition of responding to rejection with physical selfdestruction in that part of the world comes from…

As for Clapton, something tells me that wouldnt make a good snowclone :)



Note that Yaghmaei exercised the Kolmogorov Option and, unlike Ramesh, stayed in the IRI after the revolution.

For Clapton snowclones, I enjoyed a comment on https://www.youtube.com/watch?v=u7jV7IkHdqk :

> Eryczek wrote this when he was secretly in love with Patrycja; at that time Patrycja was the girlfriend of the famous Jurek Harrison!

(if you have time, while we're here there's a great yin/yang thing going on between https://www.youtube.com/watch?v=ImOYx9j0kIA , a soft Dio interpretation, and https://www.youtube.com/watch?v=zo3pfnldlD0 , a hard Andersson, Fältskog, Lyngstad, and Ulvaeus interpretation)



“You can hold yourself back from the sufferings of the world, that is something you are free to do and it accords with your nature, but perhaps this very holding back is the one suffering you could avoid.” - Franz Kafka



Python has a whole bit about how it is for "consenting adults" and that's why it lacks public/private visibility modifiers and presumably why it exposes all other manner of metaprogramming magic. If they were worried about "reasonable adults", these other design decisions would be curious. :)



Huh, that’s convenient and really useful. When I do ridiculous import hacks, i usually just do it be importing a module, that trades the ast module to rewrite code, exec it and shim in an exit(). A preprocessor would be so much more ergonomic.

I used the ast rewriting stuff mostly before dicts were all ordered - replacing fist literals with an ordered dict call, which was actually useful.

I love how flexible python is. Most cursed thing I ever did was mutating strings in place, which led me eventually abusing mmap as well to write scripts that mutated themselves. Now I feel need to write lisp interpreter as a producer.



That's quite interesting.

Now, I'm left to wonder if this could have been used to better handle the Python 2-to-3 transition, e.g '# coding: six.python2' would adjust Python2 code to be valid Python3, or '# coding: six.python3' would adjust Python3 code to run under Python2 - e.g adding/removing the b"..." or u"..." prefixes!



It could help, but the parts it would help with are the easy parts. The challenges of py2 to py3 were the runtime behavior change: a Unicode and regular string containing ASCII were the same string in py2, as in you could use them as keys of a dict and they'd key the same entry. In py3 a bytes and str of the same ASCII would identify different entries in the same dict.

Some more nasty changes: various built ins like .keys() and .values() return lists in py2 but iterators in py3. Code gets very verbose if you use the six utilities or other workarounds to translate code safely - most times those are called they are used once, but every once in a while they are used twice.

Imo if you have such a tool that can rewrite at import time you should just commit the transformed code, and clean it up incrementally. The hard parts are the behavior changes that can cross long distances like the str v bytes behaving so different than py2 Unicode v str



For the first time in a very, very long time I'm running into something that totally blows my mind and sets off lightbulbs like this is...



Super cool! It would be kinda funny to make a pseudocode python that get’s “decoded” by an llm. Obviously it would be hideous but probably somewhat fun :)



Are the dependencies introduced via this coding hook strategy picked up by `pip freeze' or uv?

Otherwise, ..have fun with that :). Probably easier to rewrite any library rather than fight such dragons (because if someone put this in, what other traps await? Seems almost guaranteed.)



> the Python developers have strong opinions

except when it comes to downloading, installing, or running anything Python related. maybe by 2124 we can give users a python app and let them run it without 20 steps. (oh who am i kidding, by then we'll rewrite everything in whatever comes after Rust)



I think the title of this needs to be changed as it implies that this is a preprocessor project named Pydong. As far as I can tell that's simply the name of this blog and this post is about how python has a preprocessor built-in if you abuse the right mechanisms.



I remember that I wanted to implement a python module that would improve upon the builtin Django groups. So following a tradition of adding ex to the end of the existing name, I named my module "groupsex".

After taking a peek at it I decided to rename it to groups2 instead :)



> The web devs tell me that fuckit's versioning scheme is confusing, and that I should use "Semitic Versioning" instead. So starting with fuckit version ה.ג.א, package versions will use Hebrew Numerals.

Big lol



> https://github.com/ajalt/fuckitpy

10 years ago this was just a joke, but today, now that we're finally agile enough so that any disorganized jumble of completely unreviewed and unversioned notebooks might suddenly become a production pipeline? Why let a little thing like critical errors halt the execution of that perfect nightmare you've been working on! The only problem is that the database still won't let you shove a string into an integer slot, but data-science is looking forward to switching over to spreadsheets completely as soon as we can migrate the data from redshift.



There are also seeeeeveral LOVE2D libraries with overtly sexual names. The most egregious example that comes to mind is the (now defunct compat library) "AnAL." There's also HUMP, Pölygamy, Swingers, Adult Lib (debatable but close enough), Gspöt, Möan.lua, fLUIds (also debatable, but there's a clear theme here), and yaoui.



* As you can see by opening the link, "pydong" is the name of the blog, not the Python preprocessor

* I'm glad that we are not ants. Deciding everything "as a community" would be hell



Also a common name as is Phuc.

I had a partner that was a translation coordinator and they would play me this VM from one of the Vietnamese translators, every time he called he would say, “Hi this Phuc, ha ha that is funny to you, anyway …”



To me it was always just a silly way of pronouncing "Python", especially in reference to terrible shenanigans like the ones the post talks about :P



I had actually considered PrePy and variations thereof for the magic_codec project (which is the example implementation showcased in that post), unfortunately all of these had been used by other projects before. Pydong is the name of the blog :)

联系我们 contact @ memedata.com