The better error messages alone make it worthwhile to upgrade. The trend started in 3.10, and it already made a difference for me, my coworkers and students.
But remember that while it's great to play with it freshly out of the oven, and that you might want to test your projects/libs with it, we should wait a bit before migrating production.
Indeed, every first release of a new major version of Python eventually important bugs that get ironed out in a later patch. Also, some libs on pypi may simply not be compatible with it yet, breaking your pip install.
I usually wait until the 3rd patch myself, after many years of paying the price of greedy upgrades.
Maybe what I have in mind as the env setup is different but 1) lower envs might not experience the load or edge cases as prod 2) lower envs are supposed to be as similar as possible to prod. Is it a good idea to test things with Python 3.11 and run it in prod using a different Python version? It might even force you to use different versions of a lib for each env which means no confidence for releases to prod based on lower env tests (one way would be to have two lower envs. One for next Python version and another for current one as in prod. But #1 is my main issue.)
Once everything gets wheels/bumped, it'll be a lot easier. The last few major versions have been fairly straight forward to upgrade once they're all in place, and the nice thing is this should hopefully fix any remaining packages that aren't built for the arm64 macs.
There was a long debate about this, and the conclusion was:
There is one way to read toml, but a lot of ways to write it (do you preserve formatting, what do you do with comments, do you allow partial updates...). Therefor reading is easy to get right, but writing less so, and once it's in the stdlib, we can't make quick changes to the API.
Since reading is already very useful, and tomli author's is ready to provide that for free, let's include it now and see writing later.
>There is one way to read toml, but a lot of ways to write it (do you preserve formatting, what do you do with comments, do you allow partial updates..
Then don't use TOML for internal stuff?
Or just settle on a way your lib writes it, and if every parser out there can read it anyway, and get the same deserialized structure, it doesn't matter which way you write it exactly...
>As for it was a good idea, this has already been debated and acted upon, there is no need to repeat exactly the same arguments.
Well, the same debates happened over many other decisions debated, acted upon, and later regretted and reverted. At some point the GIL seemed like a good decision too!
The GIL is a good decision and has been a sound engineering tradeoff for decades. It's only been the past few years that running the interpreter without a GIL has been even remotely feasible (cf the gilectomy project). The GIL is a relatively straightforward way to hold back a tremendous amount of complexity.
Similarly, TOML writing is a ton of completely. The org isn't opposed to adding toml writing to the stdlib fundamentally, they just aren't rushing and want to hammer out all of the grossness first.
Obviously the complexity level is different, but to me you sound like someone complaining about Linux adding support for a new filesystem, but read-only at first. Why all the hostility?
I have plenty of cases with yaml where I care about the formatting of the serialized output. I have to use obscure hooks into pyyaml's inner workings to tweak things just right. In some cases, I end up having to do some of the serialization myself. While technically it doesn't matter because it's all equivalent once in memory, there are externalized costs once you're integrated into a large system. The whole point of using something like yaml or toml is to be human friendly.
> The Space-BACN program aims to revolutionize the way space-based communications work by developing low-cost, high-speed reconfigurable optical datalinks to connect various low-earth orbit (LEO) constellations…and we’re looking for the best minds out there to help us make this a reality.
Also, the first accident (there is always one) redirecting the beam to a populated area is going to be so spectacular I doubt it would recover after it.
Accidents probably won't be an issue (useful power density is surprisingly safe, and safeguards can be put in); malicious redirection of multiple beams, that probably is a threat.
Multiple beams can only be guaranteed safe against malicious agents by making sure only one is in any given person's sky at any given moment, which either limits us to 6 worldwide or requires the satellites to be low enough that they're in earth's shadow.
(Last time I said this on HN, I got an angry response from someone who clearly didn't understand what I was saying; I don't know if that is because words are bad at painting pictures or not, but regardless I really ought to get around to blogging this with pictures to show what I mean).
It gives good pointers but it falls short on the usual suspects for an article on asyncio.
When teaching it, it's important to emphasis:
- await is locally blocking, so you should isolate linear workflows into their own coro, which is the unit of concurrency.
- to allow concurrency, you should use asyncio.create_task on coro (formerly ensure_future).
- you should always explicitly delimitate the life cycle of any task. Right now, this means using something like gather() or wait(). TaskGroup will help when it becomes mainstream.
A HN comment is not great to explain that, but if you read the article, you should investigate those points. There is no good asyncio code without them, only pain and disapointment.
> ... TaskGroup will help when it becomes mainstream.
Strongly agreed, but you can use anyio [1] in to of asyncio to get that functionality right now. Or, maybe even better, use Trio [2] instead, which is where the idea came from in the first place.
Serious question, why would you limit concurrency in async world? You’re still on a single thread, why would you want to only schedule n things at a time?
> you should always explicitly delimitate the life cycle of any task
Unless you want a hacky actor system, in which case it's totally fine to `create_task` a ton of corountines which have their own spin loop with await sleep :)
I’m so confused by this architecture. It makes total sense in a threaded world but why would you want a coroutine constantly scheduling itself in a loop to pull messages off a queue like thing than just having the thing generating the message fire off a task to process it directly right there? It feels almost the same to me and then you can’t crash the coroutine.
At some point even those tasks must be cleanly stopped and unless you want to play erlang and "let it crash", the actors have a lifecycle as well. Making it explicit will avoid much pain, and ease testing a lot. Also it will make resources consumption more predictable.
Wisdom for ansible would be to ditch the dsl and expose a pure python declarative api, with imperative escape hatches and a set of best practices + conventions encouraged by templates anf linters.
Instead, we get a terrible dsl baked in a bad markup language that is hard to write, painful to debug and impossible to maintain.
That you have to come up with concepts like an inventory, fact and magic variables should have been your first clue that they were reinventing badly what any language ecosystems provides for free.
And the worst is, ansible is probably one if the best deployment systems at our disposal.
That's a hot take. In my experience Ansible is trivial to maintain and, due to the lack of better templating like Salt, ensures most playbooks look relatively similar as it's meant to be a simple, straight forward task runner. Onboarding folks into Ansible is a breeze as everything matches the standard (roles, tasks, group_vars, etc). It's dumb, reliable, and does exactly what it says on the tin.
My biggest complaint with Ansible is the execution aspect. The fact that mitogen hasn't become the standard strategy plugin and instead Ansible still opens an SSH connection per task is nuts.
My experience is that Ansible becomes exponentially more difficult with the difficulty of your workflows, where programmatic tends to be logarithmic. For low complexity tasks, Ansible is simpler and for high complexity tasks it gets more complicated.
Just as a random example, for complex group structures you have to know/remember that although Ansible allows nesting groups, groups are actually a flat structure. If you have prod.webservers and uat.webservers, the 'webservers' group will include members of both.
That's not hard to work around, but it can easily lead to situations where you end up deploying to prod even though you only intended to deploy to UAT.
Variables are kind of a mess too. Assuming the docs are authoritative, there are 22 different places that variables can come from and which one is used will depend on the precedence. At some point, a 'switch' or series of 'if-elif' statements start to sound much simpler.
RE: variables, I'm a heathen and set `hash_behaviour = merge`. This forces nested dict values to be merged instead of overwritten (lists cannot be merged, unlike Salt...). For whatever reason Ansible encourages users to not use this [1], which makes variable usage far more difficult than it should be IMO and leads to situations like you describe where folks have various top level variables for overrides (ssh:, ssh_local:, ssh_global:, etc to combine values).
Oh wow, I've been working with ansible for a few years now, how have I not seen this before? I've even searched for it, but I didn't know what it was called, so...
Do you know if this behavior can be enabled per-role, or even better, per-task?
For context, I’ve written probably a million lines of Ansible and even maintain my own fork to add features like loopable blocks. I love it enough to curse its name.
Large Ansible code bases are painful to maintain. Roles don’t encapsulate well enough and the setting that makes their variables private is unusable if you need to “exports”/“outputs” and I guarantee you do, flow control isn’t powerful enough and you either supplement by dropping down to script/shell or by wring whole programs in Jinja, variables are so spooky action at a distance that you need an external tool to graph where they come from, vault variables aren’t greppable so good luck there, you can’t write a type checker because it’s all strings and any large codebase will dynamically generate variable names due to lack of expressiveness, you will desperately want a way to tell Ansible to eagerly evaluate some variables instead of keeping them as strings and find out how ugly the workaround is without your own patches, you eventually desperately wish you had the ability to evaluate filters and lookups on the target and might eventually, like me, write a plug-in for that. Your options for complex data transformations is writing 50 line filter pipelines with item.0 item.1 or dropping to python and just writing your own filter, you will also eventually desperately wish you could define new modules via “subroutines” by chaining a few trivial module invocations together and then find out that you must drop to an action plugins which expose all the underbelly of Ansible. You will pull your hair out getting Jinja to strip the whitespace from strings to get Ansible to recognize the results as an array since it’s all strings, you will find out that Ansible has its own string type that doesn’t play nice with str and that is somehow exposed to you in bog standard Ansible.
If Ansible was a Python library I would scream for joy at how much unnecessary complexity and necessary bullshit trivia I could drop from my brain.
> and instead Ansible still opens an SSH connection per task is nuts
Mitogen is not worth the bugs compared to using SSH ControlPersist.
Well yeah, because ControlPersist is just “make session creation fast” by multiplexing them over a single SSH tunnel. So you still have “ssh internal session creation” overhead but the tcp and ssh handshake is the slow part. The speed gap between pipelining with ControlPersist and Mitogen is small enough that it’s, to me, not worth the bugs and limitations of Mitogen.
Yeah after using CloudFormation, Terraform, Pulumi, AWS CDK and k8s + YAML, I'm convinced using a real programing language idiomatically is the correct way of doing IaC.
Many languages totally support declarative idioms out of the box (like you mention), there's no need to reinvent anything here.
In particular I'm a big fan of AWS CDK, although it only works for AWS. (Yes, I know about CDKTF, but it's buggy alpha software).
> ditch the dsl and expose a pure python declarative api, with imperative escape hatches and a set of best practices + conventions encouraged by templates anf linters.
Fully wholeheartedly agree but, as I stated in previous ocasions in this site, after the nightmares I've seen people, in many different places, doing with a high level tool like Ansible (and also Terraform), I apply heuristics about the probable outcome of every DevOps using a proper Turing-complete language as a general trend and I just want to leave CS and buy a hut in the middle of nowhere.
Perhaps something like that must come after a shift in the mentality of the whole business where people in CS in general, assumes one needs to be a good coder, no matter if you do DevOps of software and therefore, learn about software design patterns, reusability and best coding practices.
The issue is that Ansible right now today is just Python but if you tied chopsticks to your fingers when typing. It’s not declarative, it’s sequentially evaluated with all the flow control and concurrency bugs to go with it.
You have to already be a good coder to write Ansible but you have all your limbs tied behind your back because you
get none of the features of Python to help you reign in complexity and validate correctness.
The killer feature of Ansible vs. Python code is, noting I have a ton of both here for infrastructure related tasks (as well as shell, why not), when you have it running for three years on some box somewhere and something breaks, you go look at it for the first time in three years and it makes sense. My Python infrastructure tools OTOH, while they are great, if something goes wrong with them I have to spend half a day reading the sourcecode and remembering what their particular architcture / conventions are.
it's like the dumbness of Ansible is really the main feature it has.
I agree with you but I think that dumb + size => complicated which is where I live. When you have a playbook that is thousands of tasks long the dumbness leads to exactly the problem you have with Python.
I agree with that! my ansibles are for really straight stuff deployed to a few boxes. Where I work, oddly enough at Red Hat :), the very large playbooks are definitely difficult to work with. It's hard to say though if a custom Python app of similar size is really any better though, unless your developers are Michelangelo.
Also been going down this path. pyinfra is overlooked I think.
It's not perfect, I still feel like I'm dropping down to just hitting `server.shell` a bunch , but at least as a programmer first, it feels more comfortable vs the mountains of yaml (and doc searching) for Ansible.
On the whole it's a less frustrating experience. I still have a vague feeling that in my case - where each server(s) is generally customised per client and I've never felt comfortable just pointing ansible (or pyinfra) and a configured server and re-running it - that perhaps I would really just be better off with a bunch of shell scripts. I don't generally tear-down and throw-up multiple servers a day, week or even month.
rrconf sort of fills this but works off a bit more infrastructure than I want to manage with its different git repos per action.
I understand where you are coming from. It's interesting to see the Puppet/Chef-debate played out over and over again.
You generally want an overarching single source of truth for IT systems. One that defined which parts a system contains and how it is set up. This starts to get important when you want maintainable testing environments, and more so as the number of system integration points grow, but it generally makes tracking changes and having a controlled deployment process so much easier.
So it is natural to start with a declaration of how small pieces fit together. This is Puppet/Ansible where the language is just a list of objects, where each object is implemented in "real" programming language. But the list soon needs logic, if not for other reasons than because testing environments have subtly different requirements, and the list grows into a semi-language.
That's not enough and people new to the system soon feels constrained, why not ditch that domain specific thing and implement the whole thing in the "real" language? This is Chef/Salt. But now all you have is another object, which needs an overarching list of objects, and soon we have another simple description for that.
And then we repeat this all over again.
(There are specific issues for some parts of this, which is not part of the above story. Ansible didn't have to choose yaml for their domain specific language, they should have seen that coming. But that's not for this story. We instead get to see this repeated again in the container space with templates and Helm charts. Also Jenkins pipelines which slowly mutates to Groovy and back.)
Funny how during the cold war everyone was criticical of russia for spying on all citizens. This was a symbol of how little freedom they had, that it was a proof that communism was leading to terrible dictatorships.
But our politicians seem to think that if we do it, it's to help people.
Unlike the ussr politicians of course, because they were evil.
Not to mention verifying evidence is very hard, manufacturing evidence can be cheap, and instutitions have a bad track record about evidences.
After 20 years of internet saving the lies of people forever, showing thousands of submarine articles, photoshopped pics and now deep faked materials, can we blame people?
Yes, imo - because they don't just mistrust - they randomly trust alternatives.
Mistrust is warranted, definitely. Trusting random sources that fit their heavy bias is something we should all be hyper aware of and fight. Yet we don't.
> Yes, imo - because they don't just mistrust - they randomly trust alternatives.
> Mistrust is warranted, definitely. Trusting random sources that fit their heavy bias is something we should all be hyper aware of and fight. Yet we don't.
Not exactly, IMHO mistrust is a two step process: 1. mistrust and 2. find alternatives to trust instead, in that order. I think 1 always starts first, through 2 can accelerate/reinforce it.
Mistrust puts one in an awkward, unsupported position in a world where things are way to complicated for one person to process, and it should be expected that it will take a long time for an individual to find an adequate replacement for institutions that have lost their trust (probably through trial-trusting other institutions then mistrusting them, too).
See, when a person already has evidence that 'other' opinions cannot be trusted, due to the many things being talked about in this thread by GP; It gives credibility to the alternatives because they at least make sense to those people's confirmation bias.
Meanwhile, your own confirmation bias is being given credibility due to the things you believe to be true.
This is the truth of all information until proven as objective fact. Until proven as objective fact, anyone can claim your 'truth' is just subjective; and thus potentially and highly likely wrong.
And so it fuels the fire.
The only solution (AFAIK) to this is that everyone leave each other alone for a while and let them figure these things out for themselves by letting good ol father time teach us what is right and wrong. Time. It's one thing in the universe that might not be lying to us, at least all the time; unlike humans who can't stop lying in attempts to ego stroke over being right.
> The only solution to this is that everyone leave each other alone for a while and let them figure these things out for themselves by letting good ol father time teach us what is right and wrong. Time. It's one thing in the universe that might not be lying to us, at least all the time; unlike humans who can't stop lying in attempts to ego stroke over being right.
Man, i couldn't disagree more - about this actually working, that is. This seems to assume that with time we will progress. I have seen the opposite enough to believe that we can, but also can just as likely regress.
There are many out there that want to go back to removing rights from people based on skin tone, orientation, religion, gender, etc. Too frequently we reach a regression milestone that originally was projected to be the end of the regression, only to have us ramp up for the next regression milestone and fight over whether the next milestone is the end.
I have zero faith in humans ability to cope here. I'm not sure on the solution, but to me it feels like we have a series of radio broadcasts which purposefully brainwash us and our only inclination is to turn the volume up, and make sure the neighbor can hear it through our windows.
I am very, very pessimistic on our ability to dig out of this when we still willfully dug ourselves in to begin with.
father time? time by itself does not explain anything... is the new evidence that happens over time the one that teaches us. We are just doomed to a mostly monotonic growing time function. So we need action not that invitation to sit down and wait for the next time chunk to hit.
1. I never said it would happen quickly. Thing is, humans are rather impatient generally speaking. Especially when they think they are correct about something and must spread the enlightenment of their ego unto others.
Time, doesn't wait on us. We wait on it.
Here's an example: I play some MMO's now and then, and with the kind where people are fighting over territory in the game, all sorts of real world type politics ensue. Sure, it's just a game, but those are real people playing, meaning real brains doing things that they do; even in the real world. People who are actually morally upstanding act one way, and people who are actually terrible under their societal masks are... well... the other.
Sometimes you get to deal with drama that is absolute bullshit, where the people who are less than morally upstanding cast out a bunch of lies, mistruths, and royal stinkers.
What's the best way to deal with this? You just keep on doing what you do, provided it's not actually wrong, and leave them alone. What happens?
Well, in my experience, the rest of the actually morally decent and upstanding people take notice of this, and then go on to cast out the liar.
Now, you may want to say "But that's just a video game" or "That's just the internet".
But I disagree entirely to the ends of the earth. Humans are humans, no matter how or where they communicate. The only difference is that some have less inhibitions to do certain things, much like how alcohol affects them.
So the end result for me in these kinds of situations both IRL and online, is eventually people wise up. They eventually figure out that Manu40 isn't really the problem, and the real problem is the other asshole. (I say it that way, because I absolutely can be an asshole if I want to be.)
I've seen this sort of things play out with myself, and others, so many times; that I cannot agree with you. I can see where you come from though. Which brings me to #2.
2. Generally speaking, most of those problems you speak about in regards to rights, religion, race, gender, sex, orientations, etc, etc... most of these problems stem from people not leaving each other the F alone. These all stem from people being overly concerned, or angered by, or jealous of, or etc other feelings about other people.
I.E. If they just left each other alone, most things would be fine.
But humans don't like doing that, because again; ego. (And possibly a tinge of societal narcissism.)
You have zero faith in humans ability to cope; but might I ask you without seeming to be attacking you, if perhaps that might be part of the problem here.
You are not alone in your feelings, and so others act in a way to try to rectify each other in the guise of their opinions being holier than thou.
Do you see now why I say Time and leaving each other alone would help solve this problem?
I'm not saying it is going to resolve itself immediately or overnight in any way. It could take a long, long time. Weeks, months, even possibly years.
What I AM saying, is that so long as people are constantly getting up in each others face and shoving their opinions down each others ears and throats; none of this will get any better, until it gets bloody. And then, it could still be argued that it never got better; it's just the killers are all that's left over.
Not victors, killers. Because there is no victory in killing each other over opinions, and that's what this will turn into if people don't get over themselves, and leave each other the F alone.
I mean shit, I'm guilty of it right now too by even replying to you to potentially help have you see things from my point of view; and so are you in reverse.
Ideally, we'd all just stop typing and talking, and just mind our own damn business.
But that's hard, because like it or not; some of us are actually right, and yes you and I could be wrong right now. The solution could be something that neither of us have even thought of yet.
lol, I don't blame you for guessing that one, but no. I did have an account once upon a time ago, but I never went very far with it.
I speak of other games like New World and good ol ARK. I guess one might not consider these to be an MMO, but I do, since there are many players on many servers; though the numbers may vary.
Of course not, plus the last two decades included two bullshit wars (straight lies), an economic collapse where institutions lied, and hysteria over the severity of Covid on key demographics (masks, politicization, and lockdowns on non-critical demographics, e.g non-seniors).
And that’s just America (or the West). How anyone trusts foreign governments of the totalitarian type is something else entirely.
This is what drives me absolutely nuts whenever I read about current events. Pfizer had to pay the largest fine in US history for a fraud case, yet questioning their data (which we weren't allowed to see until they were sued) is forbidden. We spent decades destroying the middle east with the justification being based on lies, yet to question the motives of the US in the current war is to be a traitor. Fauci was the one in charge of the response to AIDS, which everyone seems to agree was horrendous, yet he's now a national hero.
I really struggle to understand how everyone can just go along with it all and forget about everything when the next thing starts.
> Fauci was the one in charge of the response to AIDS, which everyone seems to agree was horrendous, yet he's now a national hero.
That's a very self-serving argument cherry picking from history.
Fauci was initially hated by the AIDS activists in the 80s but worked to gain their trust. You also don't factor in the societal hate americans had towards the gay population preventing research towards a cure.
Here's an article that gives a detailed account of what it was like back in the 80's.
> Pfizer had to pay the largest fine in US history for a fraud case, yet questioning their data (which we weren't allowed to see until they were sued) is forbidden.
Questioning it is fine, and the data should be public.
But also note that Pfizer also has credibility because they have made a decently high ratio of non fraudulent claims since they have a history of making and selling medicines that work.
>"I really struggle to understand how everyone can just go along with it all and forget about everything when the next thing starts."
My worldview is that all of us are far more "in-the-present" than we realize. I sense most people want to help, want to conform with what is seen as serving the greater good, and are willing to follow the lead of what the group seems to be doing. Not only are we overloaded with information, if we aren't being reminded of what "the good guys" did in the past that was either wrong or hypocritical, we won't know to make a fuss of it. Same story with "the bad guys" having done good things in the past.
The most eye opening thing for me was seeing the American political left embrace Liz Cheney while the American political right disavowed her. That flip was unexpected, but it makes perfect sense when it comes to what is immediately expedient.
But remember that while it's great to play with it freshly out of the oven, and that you might want to test your projects/libs with it, we should wait a bit before migrating production.
Indeed, every first release of a new major version of Python eventually important bugs that get ironed out in a later patch. Also, some libs on pypi may simply not be compatible with it yet, breaking your pip install.
I usually wait until the 3rd patch myself, after many years of paying the price of greedy upgrades.