Live data from Hacker News

Python’s Preprocessor

pydong.org

81–90 of 109 posts

Re: Python’s Preprocessor

#81
post #76

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 i…

> mutating strings in place

They’re immutable. Were you directly writing to the memory location with ctypes or something?

Re: Python’s Preprocessor

#82
post #47

Earlier quoted context omitted.

PrePy could have worked... I guess lol maybe it was taken, cause Pydong... yeah.

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 :)

Ah I did not realize this. Whoops. Thanks for clarifying!

Re: Python’s Preprocessor

#83
post #68

> 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)

https://pyinstaller.org/en/stable/

Yep, that proves my point, thank you

Re: Python’s Preprocessor

#85
post #73

Earlier quoted context omitted.

It's always so cool to see this kind of Easter eggs. So sad that they're not as common as they used to be.

There are all sorts of easter eggs and jokes in Python, for example a joke about blind people that GvR prevented from being reverted: https://marc.info/?l=python-dev&m=130991276326041&w=2 In 2024 suddenly everyone is grown up and corporate and has never done anything wrong.

> 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.

Re: Python’s Preprocessor

#86
post #73

Earlier quoted context omitted.

There are all sorts of easter eggs and jokes in Python, for example a joke about blind people that GvR prevented from being reverted: https://marc.info/?l=python-dev&m=130991276326041&w=2 In 2024 suddenly everyone is grown up and corporate and has never done anything wrong.

> 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.

[flagged]

Re: Python’s Preprocessor

#87
post #76

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 i…

> mutating strings in place They’re immutable. Were you directly writing to the memory location with ctypes or something?

Yep!

Re: Python’s Preprocessor

#88
post #73

Earlier quoted context omitted.

There are all sorts of easter eggs and jokes in Python, for example a joke about blind people that GvR prevented from being reverted: https://marc.info/?l=python-dev&m=130991276326041&w=2 In 2024 suddenly everyone is grown up and corporate and has never done anything wrong.

> 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.

[flagged]

Re: Python’s Preprocessor

#89

Earlier quoted context omitted.

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 C…

Literally: it's difficult to avoid pain, but suffering is optional

“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

Re: Python’s Preprocessor

#90
post #14

>>> 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…

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.

I think OP is commenting more so on the reversal of the developer’s relationship with rules of syntax than their personal capabilities.
Post reply on HN