Reading: cyclic GC, yes, the section I linked explicitly discusses that problem, and how it’s solved.
Reading: cyclic GC, yes, the section I linked explicitly discusses that problem, and how it’s solved.
yeah no. you need an acyclic structure to maybe guarantee this, in CPython. other Python implementations are more normal in that you shouldn't rely on finalizers at all.
> It is possible (though not recommended!) for the __del__() method to postpone destruction of the instance by creating a new reference to it. This is called object resurrection.
[0]: https://docs.python.org/3/reference/datamodel.html#object.__...
You can and should store SQL queries in VCS. Everyone can still know that they're there.
Except this works in most major vendor SQL implementations. And they all support relation aliases in SELECT... Seems the standards have long fell behind actual implementations.
SELECT id AS foo
FROM MyTable
WHERE foo = 1;
Similarly, you can’t do this: SELECT id
FROM MyTable
WHERE id = MAX(id);
Because in both cases, when the WHERE predicate is being executed, the engine doesn’t yet know what you’re asking it to find - for the former, SELECT hasn’t yet been called, so the alias isn’t applied; for the latter, the aggregation happens after filtering, so it can’t know what that maximum value is.You can of course alias columns for SELECT however you’d like, and can also use those aliases in ORDER BY. You can also trivially refactor the above examples to use subqueries or CTEs to accomplish the goal.
I use Neovim and tmux because I value snappy performance, and never having to leave the keyboard.
The reason I don’t like auto-complete is that it interrupts my thoughts. Once I’m typing code, I know what I want to do, and having things pop up is distracting. Before I’m typing, I’ll think about the problem, look at other code in the codebase, and/or read docs. None of that requires autocomplete, nor would it help me.
If you like autocomplete, great, use it, but don’t assume that it’s a binary choice between plaintext editing and Copilot.
I don’t know all of its API, but I do read the docs periodically (not all of them, but I try to re-read modules I use a lot, and at least one that I don’t).
We use migrations as the source of truth for the prod database schema, but they’re also a pain when you want to just see the latest version of a table or a stored procedure.
pg_dump --schema-only
Read tool docs for other options, like restricting to a specific DB or table, but that’s the basic gist of it.