Hacker News new | past | comments | ask | show | jobs | submit | dpwm's comments login

From the PEP:

> A tool will be provided to automatically update code to replace bare except: with except BaseException:.


That's besides the point. I don't want to muck about with tools on my Python scripts.

I have sometimes not run a Python script for a few years, and then when I need it, it stopped working and I need to track down what changed/broke or run some tool or whatnot. I don't keep track of the latest greatest Python changes – like most Python programmers it's not my "day job" to write Python code so I now need to track what changed between "the Python version I used about 3 years ago, whatever that was" and now. It's pretty annoying.

And that's assuming said tool will be fool-proof. Never mind of course that all my dependencies (if any) will need updating too.

What will happen in practice is that people will write "except Exception:" rather than "except:" and do nothing different. Basically nothing will change.

Meanwhile, I have C and Go programs that have worked without modification for about 10 years. Not that nothing ever breaks in C or Go, but it's the exception (hah!) rather than the rule.


> like most Python programmers it's not my "day job" to write Python code

I’d love to know whether that’s true, and to what extreme. I believe you’re right - that people using Python for a few hours a week (or less) greatly outnumber software developers using it as their primary language.

I think that’s a real issue for the evolution of Python, because updates to the language design (e.g. the makeup of the Steering Council) come almost entirely from the second group.


> I think that’s a real issue for the evolution of Python, because updates to the language design (e.g. the makeup of the Steering Council) come almost entirely from the second group.

Yes I agree, and it's disappointing to see some take such a narrow view of things.

A big part of maintaining and evolving a language is saying "no" a lot. There are a lot of people with ideas, almost always reasoned from their own use-case. That's okay, everyone does that to some degree, but there almost always trade-offs and such to consider.

Your job as Steering Council or Core Dev or BFDL or whatever governance you have is to consider all use cases and make a balanced decision. Reading that thread, some do. But unfortunately others don't.

Even for Python 3, Guido spent most of his time saying "no" to proposals. There were a lot of pretty wild ideas for Python 3000.


Which just underscores the point that this is mostly software engineering theater. If your goal is a system in which all exceptions are explicitly and appropriately handled, your first mistake was picking Python.

I propose a rider to the PEP in which implementation will be deferred until its proponents can correctly affirm that the library reference lists, for each function and method, every exception it might throw.


>If your goal is a system in which all exceptions are explicitly and appropriately handled, your first mistake was picking Python.

No, the goal is a system in which the code correctly indicates which exceptions it's intended to handle, and doesn't accidentally handle the wrong exceptions because the developer was either lazy or misinformed about the semantics (perhaps due to experience with a different programming language).


> ...and doesn't accidentally handle the wrong exceptions...

What support does Python offer, to the author of a function, for determining what would be the wrong exceptions for it to handle? How, in Python, does the author of a function signal, to the functions she is calling, which exceptions they should not handle? As I alluded to in my previous post, the Python language and documentation does not even give programmers a good accounting of what exceptions the library functions might throw.


The point was about how the set of exceptions handled by `except:` might not match what the programmer expects, especially a programmer coming from a different language. It's not about knowing what kinds of exception the code in the `try` could raise and it isn't about telling a called function what to do.

Other languages, notably Java, have tried the "functions document what they can raise" idea. Everyone seems to hate the result.


Thank goodness there was 2to3 tool in the past. It made the migration to Python 3 so smooth and quick. /partial-s

I know it is not nearly on the same level, but people seriously overestimate the effort needed between not doing anything at all and even the slightest work, no matter how reliable and easy. The difference between nothing and anything is huge.


I feel like I've heard this argument countless times, and yet I'm never swayed by it. I've been using Python for about 20 years and I've never felt put out by the need to change anything to work with a new version of Python (or of a library). It simply hasn't caused significant pain - my memories are more filled with painful debugging sessions caused by overly-clever designs or trying to refactor too much at once.


will there be a tool to upgrade all direct and transitive dependencies of your project to make them work in that new interpreter?


I propose to call this tool 3to760, in memory of 2to3.


Yeah that's the normal way in physics in my experience, certainly from undergrad level up.


As used on HN. It just works, even today.


Although there is some degree of silliness to suggesting table layouts in 2024, it frankly really is not that bad. To me personally, the era of float: left and clearfix and 10 layers of wrapper divs was significantly more of a mess. "Oh look, I got my layout working on IE6! Oops, it's now broken in Opera..." Anyone remember using invalid CSS to write browser-dependent styles? How about using Microsoft's proprietary DirectX filters to make PNG transparency work? In the era of taking crummy PSDs full of graphics and chopping them up into images for an HTML template, these were the tools of the trade.

Not that tables were perfectly standardized or anything, because I do remember Netscape and IE not totally agreeing on how to handle column widths, but they sure were, well, simpler.


Yeah, but HN uses tables in a really dumb way. Each comment is in a separate table with the width of the first column set to provide the correct amount of indenting.

If the comments were properly nested you would just have a standard left margin and the tables would be completely unnecessary.


The article links to Mozilla’s press release / blog entry about the acquisition of Anonym [0]. It’s pretty dystopian reading. The last three paragraphs and the summary of Anonym are more worrying than anything else I’ve read on this so far:

> This acquisition marks a significant step in addressing the urgent need for privacy-preserving advertising solutions. By combining Mozilla’s scale and trusted reputation with Anonym’s cutting-edge technology, we can enhance user privacy and advertising effectiveness, leveling the playing field for all stakeholders.

I can only interpret this as the urgent need is money, and wants to sell its "scale and trusted reputation". Mozilla has been down this road before. It was not good for them.

> Anonym was founded with two core beliefs: First, that people have a fundamental right to privacy in online interactions and second, that digital advertising is critical for the sustainability of free content, services and experiences. Mozilla and Anonym share the belief that advanced technologies can enable relevant and measurable advertising while still preserving user privacy.

This is some pretty weak wording for a press release. The economics of the situation are that advertising will always trump privacy. Researchers have successfully de-anonymized anonymised data sets, including medical records. Why would these data be any different?

> As we integrate Anonym into the Mozilla family, we are excited about the possibilities this partnership brings. While Anonym will continue to serve its customer base, together, we are poised to lead the industry toward a future where privacy and effective advertising go hand in hand, supporting a free and open internet.

Anonym’s customers are advertisers, right? The same people who for decades poured money into eroding that free and open internet that we had…

> About Anonym: Anonym was founded in 2022 by former Meta executives Brad Smallwood and Graham Mudd. The company was backed by Griffin Gaming Partners, Norwest Venture Partners, Heracles Capital as well as a number of strategic individual investors.

Well, it seems Anonym, Smallwood and Mudd had a nice piece about them written in the Wall Street Journal [1]. From the second paragraph:

> Graham Mudd and Brad Smallwood each spent more than a decade building Meta’s advertising system, which allowed the company to offer granular data about how ad campaigns worked with individual users, often by tracking their web and mobile activity.

[0] https://blog.mozilla.org/en/mozilla/mozilla-anonym-raising-t...

[1] https://archive.is/17c0f#selection-5751.0-5751.246


The whole acquiring Anonym thing is almost guaranteed to go wrong. Either Mozilla just wasted a lot of money buying the company as it fails to be profitable or privacy will be eroded as Mozilla starts profiting from ad sales.

The companies buying ads aren't keen on privacy, at least not if it comes at the cost of optimizing sales, so I don't see anyone but small "do good" niche companies would buy into what Anonym is selling. Alternatively Mozilla will make money and start relaxing privacy restriction in order to extract even greater profits. I don't see them stopping half-way. The Mozilla leadership has again and again shown that they do not understand their user base.

Firefox is a great browser, but so it all Chromium based browsers. Mozilla apparently never considered why someone might stick with or switch to Firefox, when Chrome, Edge, Safari and other browsers do the exact same thing, sometimes perhaps better. I really want to ask the Mozilla CTO and upper management what they think their product is, because I got a in increasing hunch that Firefox isn't the first thing that would come across their lips.

Personally, right now the only reason I'm not switching to something like Vivaldi is my desire to ensure that rendering engines beyond Blink is represented in statistics.


> Mozilla has been down this road before. It was not good for them.

Yes, this is Cliqz all over again and that scandal cost them most of their German userbase.


And which browser are using the German now ?


Chrome, which meant Mozilla managed to scare people away from their own browser into a using a browser which respects user privacy even less. Great job there Mozilla!


> Chrome, which meant Mozilla managed to scare people away from their own browser into a using a browser which puts less PR focus on claiming to respect user privacy. Great job there Mozilla!

FTFY. Both browsers have been pretty bad for privacy for a long time and are more than happy to exfiltrate your data to the respective operators without your consent.


I would say, average user is using Microsoft Edge(whatever that comes default with their OS) on their desktops and a combo of Chrome/Samsung/Safari on the mobile.

While Chrome adverts and fearmongering campaigns are now everywhere and people seem to be taking interest in Chrome, but Edge is probably the most common, as I see it literally everywhere(including public service office facilities).


In England and Wales, at least, there’s even a legal principle that information produced by software is correct unless it is proven otherwise. [0]

[0] https://openaccess.city.ac.uk/id/eprint/32105/


About 1.8e20 US cups according to Google.


Well, that's the first time I've seen cubic miles used as a unit. For reference it's about 4.4e19 litres or 4.4e16 cubic metres.


I don’t think it’s that uncommon. For one thing, it is listed in the NIST Guide to the SI (https://www.nist.gov/pml/special-publication-811/nist-guide-...)

It also, IMO, beats acre-foot as a generic way to describe volumes (who even knows an acre is a chain by a furlong?)


The length of a mile varies across jurisdictions though. You'd think the world atlas would be mindful of the gap.


It’s similarly difficult to have an intuitive grasp regardless. And I’m an SI-loving engineer.


e19 and e16 are both absurdly large, which is probably why they used miles. Maybe kilometers would be better for folks who need it in SI.

Edit: And I see someone quoted the value from the article apparently few of us read completely.


> The new figure stands at approximately 43.9 million cubic kilometers

quoted from the article


Can confirm Bard is available in France and the UI has been translated to French.


For those interested in using AES with reduced rounds as a PRNG, it is covered in the paper "Parallel Random Numbers: As Easy as 1, 2, 3" by John Salmon et al.

https://www.thesalmons.org/john/random123/papers/random123sc...


Interesting article. Probably better to link directly to where it was originally published, because there are pictures: https://theconversation.com/if-the-first-solar-entrepreneur-...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: