@1st1 Not sure if it's serious. I did actually miss this a couple of times so far, but the workaround is easy enough. But like Armin, I'd really love more focus on cheap userspace threads (with cancellation).
@rockorager@mitsuhiko Any ANSI escape would indicate a tty. Many processes however perform tty-related syscalls before producing any output, or conditionally enable vt100 based rendering if either stdin or stdout is a tty. What exactly would you like to achieve?
@mitsuhiko If you own the stream, you can see if it requests alternate screen and if it does always assume it wants a tty.
Non-alternate screen would be tough.
I have been churning on a decent protocol for something like this, haven’t come up with a good answer yet. Any ideas?
⏰ New PEP alarm! ⏰
Limitations in software engineering are meant to be broken. For years I was bothered with the gap between Python and TypeScript: one has incredibly dynamic and powerful runtime, the other has incredibly dynamic and powerful type system.
So why not both? 🔥
@raymondh@property Actually, I even stopped using `property` at all, unless there is no other way and can't be happier. Access to unbound methods; ability to add parameters if I have to and clear separation between data and OO-interface.
#Python design tip: Only use @property for O(1) operations.
People rightly expect that anything that looks like attribute access is fast.
Don't want to Cntl-C out of an attribute lookup that Deep Thought takes 7.5 million years to compute:
>>> life.meaning
42
@unclebobmartin So, do you mean that types are redundant for the AI, because given a good test suite, that information is already encoded in the tests? (trying to understand, not sure I agree)
The argument can be made that statically type languages are better for AI agents than dynamically typed languages. The argument is that statically type languages are so overloaded that the AI agents can make better sense of them. By overloaded, I simply mean that you have to say everything more than once.
For example:
Dog dog = new Dog ();
I think this argument has some merit, however, developing a system using AI agents without a good solid suite of unit tests, and a good solid suite of acceptance scenarios is suicide. So I think there’s enough overloading to negate the minor benefit of a statically type language.
@willmcgugan Yes, polymorphic functions, but in that case, the caller is not supposed to know which precise implementation it's calling, so there is no way to statically assume it's one specific implementation where the result is always `None`. So there is little to statically verify.
@jonathan_s If it is a method on a subclass, then it could still be meaningful. You might be overriding a method which returns "int | None" with one that just returns "None". So there are meaningful Nones and meaningless Nones.
I kind of wish Python had a way to distinguish between a function return None and a function which doesn't explicitly return anything.
At runtime there is no differences. But maybe typing could have a "-> void" return type. That way the caller could get an early warning if they do anything with the return value.
Or does that exist already in some form?
@willmcgugan If a function has `-> None`, does it not always have no meaning? This could be enforced by a type checker without introducing a different annotation.
@jonathan_s But what I'm looking for a return type that disallows everything. if a return of None has no meaning, then any operation on it should be flagged as an error. Including assigning it to a variable, or appending it to a list, etc...
I answer about a dozen or so emails every week from students and early stage founders. One of the most common red flags I see are people who want to be a founder for the sake of it and are chasing ideas or guessing. It's so common I have a canned response. Here it is:
(Starting the canned response here)
I’m sorry to say it sounds like you’re searching for an idea. Or, you have a solution in need of a problem. Or, you just like the idea of being a founder (for whatever reason).
This isn’t what you want to hear, but go get a job and work for awhile. If you have a solution that needs market validation, then work in the industry that you think that market exists. Immerse yourself in some industry, it really doesn’t matter what one, because they’re all so filled with problems that need to be solved that you can choose anything.
It only takes one or two years.
Then your problem isn’t going to be wondering “is this a good idea?” “What is a good idea?” Etc. The problem is going to be: which of these 10 obviously good ideas won’t be solved unless I do it, and which do I want to spend the next 10 years of my life working on? That’s the real hard question.
Remember, the key questions a VC is going to ask you and you should ask yourself is: “Why this? Why now? Why you?” You should have full confidence in all of them. The easy part is confidence in all of them. Then the hard part is executing fast enough and hoping the market moves with you with external factors that are mostly out of your control. :)
Don’t search for an idea. Let one come to you. Go get a job.
I’m sorry to tell you that, but it’s the advice I think you need to hear. Like I said, it won’t take long, one or two years or so. But that one or two years of working is going to save you more years of your life most likely wasting your time on the easy part (finding the idea). Plus, you’ll get paid for it.
@willmcgugan If the amount of data is small, then a Pydantic based table structure serialized to JSON works great. Very fast, easy to add constraints, typed out of the box. Make all data frozen if you want (immutable copy on write). Only disadvantage is that it doesn't scale beyond megabytes.
I'm joining Vercel to lead the newly formed Ministry of Silly Walks (cough, build the best Python cloud in the world!) and I'm bringing my team with me. Gel has been acquired by ▲Vercel. 🧵
@willmcgugan I'd really want libghostty Python bindings for this. The Pyte library is the best we currently have. Trying to reimplement a terminal emulator is IMHO a wast of time unless you're really okay with a subset, too many details that are hard to get right.
I built a passable ANSI renderer for Toad, so that it can embed the output of shell commands and tools.
I had thought this would be limited to a modest subset of terminal features and output only. But I'm now of the opinion that I won't be able to avoid a more complete emulator. Enough to build a terminal multiplexer.
So that's what I'm working on.
Once I can run toad inside toad, I will consider it good enough.
Wish me luck.
@mitchellh I'd love to see Python bindings for libghostty as a substitute for the Pyte library. Maybe then I will revive the pymux project so that we have a libghostty powered terminal multiplexer (tmux clone).
Neat, someone created an npm package on top of libghostty for converting streams of terminal sequences into HTML using the new HTML formatting capabilities in libghostty-vt. Also a good example of how to expose libghostty via npm. 😍 (Link: npmjs.com/package/ghostt…)
An excellent comprehensive review of the state of unicode handling in terminals in 2025. I'm happy to see Ghostty scored an overall 100/100! We work really hard on Unicode support and this report gives us a good roadmap for what we need to work on next. jeffquast.com/post/state-of-…
@willmcgugan If print were to return its first argument, the REPL would print everything twice, because the repl prints the outcome of every expression that doesn't evaluate to None.
I'm not sure if this is a serious thought or not...
But it would be nice if Python's "print" returned the first argument.
Consider this line...
match match.groups():
I want to print the result. So I would do this:
groups = match.groups()
print(groups)
match groups:
I can see the value of groups, but I've added 2 additional lines. Lines which I'll likely end up putting back when I'm done debugging.
But if print returned the first arg, I could do this:
match print(match.groups()):
A much smaller change, that I can easily restore. It would also allow me to selectively see parts of an expression.
I could easily create such a function for debugging, but it would be nice if that were builtin.
Crazy idea? Since nothing depends on the result of print I can't imagine it breaking anything.
But then the fact that Python doesn't do this suggests that it was a bad idea. Doubt I'm the first to think of that.
@kellabyte We sync all user data in real time over a web socket into the browser. However, for modifications, we still POST/PUT in order to avoid the complexity of 2-way sync and have atomic transactions. On the front-end it's not an SQL DB, but a reactive Vue.js model that holds all state.
I sometimes wonder how many web apps could simply sync data between DB and client DB like in browser TursoDB or chDB (clickhouse).
No need for complicated backend APis. Just crud data sync APIs.
No complex queries running on the server. Mostly serving or updating deltas only.
Here's my general daily schedule, for people who asked:
- 530 awake
- 600 coffee outside w/ wife (or walk), talk
- 630 laptop opening, emails
- 645 OSS triage, try to get a merge in
- 730 wake up daughter, eat breakfast
- 800 work begins
- 1330 break time (gym, games, resting, whatever)
- 1530 wake up daughter (nap)
- 1530 - 1930 family time
- 1930 daughter goes to bed
- 1930 - 2130 family time w/ wife
- 2130 sleep
Obviously things shift all the time, but this is the rough outline of what my everyday looks like.