Hacker Newsnew | past | comments | ask | show | jobs | submit | more guiand's commentslogin

I swear by type hinting in Python, but it is pretty frustrating how many common patterns don’t work or require very convoluted use of typing.

It’s an uphill battle to convert a team over to using hinting because of how awkward things can get and how easy it is to just pretend the feature doesn’t exist.


The problem is that people try to turn type hints into static types. I got rid of mypy from all of my projects as it provided no value and just created this constant battle of "making it work" - a collosal time waste. As this blog illustrates - so much extra effort for something so trivial and unimportant - this whole shebang goes against the spirit of Python.

In general I've yet to see what these type check systems (be it mypy, pyright or any other) offer over proper tests. Type hints are there for developers not the machine.


I'm going to hard disagree with you here. Type hints are a key tool in working on a large Python project in a large team. Tests are, of course, necessary. But type hints allow Python (and all its benefits) to be used in industrial environments where it otherwise would be intractable.


It sounded to me like they agree with you -- type hints are valuable -- just with the caveat that satisfying the tooling around them is a waste of time when most of the benefits can be had with minimal effort writing type hints explicitly for the consumption of other developers.

E.g., when I write numerical python code I'll often just use a string like `"(n_items, n_dims)"` as the type hint, or if the only salient detail of a signature is that some dimensions match I might even write something as simple as `foo(bar: "(a, b)", baz: "(b, c)")`. Ofttimes that's the only data a developer really cares about in that programming context, so a more complete type hint (one designed for mypy and the rest of the tooling) would just take longer to read and understand.


exactly! What I meant is that returns on mypy compliance investments are extremely poor. For most projects it makes no sense to invest so much time playing this "hack this hint" games but for big projects every single digit% improvement counts.

Most projects don't need it and I can't help but facepalm when I see small projects have half of their commits describing typing compliance battles just because mypy came with "yet another python project boilerplate" or pressure from the industry.


> In general I've yet to see what these type check systems (be it mypy, pyright or any other) offer over proper tests. Type hints are there for developers not the machine.

In a language with proper first-class typing, the advantage is that they're included in your automated refactoring rather than needing manual updates. But yeah I've never found optional type systems to be any use.


> people try to turn type hints into static types

The only way for type hints not to be static types is to not run the checker before deploying.

Static typing means that the types of variables and their values are statically checked (hence the name) before the execution; in most statically typed languages that happens at compile time. There is no static check at runtime, and it's perfectly possible to send an incorrect type to a dynamically loaded library even in compiled languages (which usually, but not necessarily, results in crashing he program).


Python sucks, type hints border idiocy. If you can't trust the hint to actually be correct and still have to check for yourself, they become pointless.

If you want to see where static typing really shines, try writing some Haskell. It's an absolute delight.


What do you mean you can't trust them? If you write a type hint in your code and then run mypy on it, it will tell you whether the type is being violated. And, PyCharm has a type checker built in that lets you know as you're coding.


> If you write a type hint in your code and then run mypy on it, it will tell you whether the type is being violated.

Only if the type hints for all the libraries you use are correct (and in practice they're not).


Ah, thanks. I think I am going to give type hints another try.


Yeah, it’s always awkward to have to declare a variable or add an assert or a weird cast thing to make the type checker happy. Basically any case where type hints have to be evaluated at runtime for syntactic correctness.

The import pattern in the article is actually something I’ve never encountered because of how common the HAS_MODULE pattern is. I’ve never even thought to override the module binding.


Sounds like exactly the use case of a server. Rack space is expensive, condensing it can save the operators money.


OP’s entire post is defining ‘not a good company’ and asking what’s left…


> OP’s entire post is defining ‘not a good company’ and asking what’s left…

Then maybe OP needs to pack up and leave the Earth, because there are no good companies and everyone is terrible and evil.

I jest, but seriously, he/she should get a grip. If OP thinks everything is terrible, maybe the problem isn't the companies...


still not a definition of a 'good company'

If I would have to guess, OP may want to go into a non profit or a creator based company like Kickstarter or companies that have joined to be a B Corp [0]

[0] https://www.bcorporation.net/en-us/


At least one MLM-based pyramid scheme is a "B Corp". That tells you everything you need to know about "B Corps".


at least one x is a "y" for pretty much any y you choose. that doesn't tell you much about "ys" at all.


When the entire point of the scheme is to distinguish companies that have a positive impact on society, there should not be room for "at least one" company that scams financially-illiterate people & encourages them to swindle their friends.

B Corps are bullshit and should not be seen as a sign of quality.


then don't go to that company?


No my point is that the whole concept of "B Corp" is bullshit if a scam company that exploits financially-illiterate people at scale can be classified as a "B Corp".


OK, then one would just tell B Corp to remove them the list no? I don't see how this invalidates all companies on that list.

What company is this anyway?


Arbonne (https://www.arbonne.com) is one example and they proudly claim to be a B-Corp on their website right under the offer to join the pyramid scheme as an "independent consultant".

> then one would just tell B Corp to remove them the list no

This is not something that flew under the radar and can trivially be removed - the aforementioned company's business model is well known for example and despite that they became and are still a B-Corp.

My point is that B-Corp is happy to accept companies whose business model preys on and profits off vulnerable, financially-illiterate people, directly contradicting their claim of certifying companies which have a "positive impact on society, workers, the community and the environment" (from Wikipedia, emphasis mine).


There is a procedure for this:

https://bimpactassessment.net/complaints-procedure

It seems you can get them removed and it does look like you are complaining about a company that shouldn't be a B Corp, so you could take your complaint there.

Not sure if that means that all B Corps or B Corps are bad in general.


Note that it’s a qualified claim: 3x as efficient as the “average propellor of a small boat”. The tech looks awesome in the video though, would recommend giving it a watch.


Yes, mesmerizing how it moves quickly across land and in snow and water as well, I wonder how much faster such a propulsion design could be optimized to move, and why it has not been explored more for full size off-road vehicles etc. I wonder if it's the actuator/software control system that is easier to build now, as it looks like that is where the magic is in moving efficiently in the water, and on land.

Video of it in action: https://youtu.be/JVq0adTn0_w


I think the intent would be to filter out SEO spam essentially, and get you a small primary-source website. Like searching for "san francisco restaurants" gets you some much more interesting results on MS than on Google.


One particular thing that has always deeply concerned me about Amazon is the cognitive dissonance: they aren't a store but a platform, and yet they can exert total control over the store in an anticompetitive way when it suits them.

They banned selling the Chromecast and Apple TV [1]. Isn't that curious? They don't have to exert quality control over the Amazon marketplace because they just Connect Sellers to Buyers. But if that seller happens to compete with an Amazon product, sorry! No-can-sell.

[1]: https://www.cnet.com/news/amazon-to-stop-selling-google-chro...


That's a fair comment. But the answer there is to require them to stop banning competing products and run a neutral platform.

There are two issues with that. The first is it won't satisfy the people who demand that amazon be killed. The second is that actually running a neutral platform would mean amazon could no longer ban other products (firearms, nazi materials, alcohol, dangerous chemicals etc).

I think the issue here is that there is no easy answer to any of the overlapping issues that large platforms represent. People don't know what they want and often want mutually exclusive things (more safety and less restrictions). There is ban behaviour on all sides.

I'm concerned that mostly people seem to coalesce around the most extreme outcomes (and those are least likely to improve things). you get a lot more support for "break up amazon" than "some amazon activities may be a utility and a natural monopoly and others not. And that requires different regulation. But there are downsides to that and they are also serious and unpopular. And we also shouldn't throw the baby out with the bath water. And there are plenty of examples of similar issues in non-tech. So we have a systemic issue as well, though how we deal with this can inform further action. And whatever we do won't be 100% correct".


Fault injection is a really interesting avenue for exploiting things like game consoles, where bootloader exploits tend to be the holy grail and where dumping decryption keys is huge for emulators.

It was used on the Nintendo 3DS, for example, to get the CPU to take an exception during bootROM execution [1], which combined with some other flaws allowed dumping the ROM with all of its keys.

https://derrekr.github.io/3ds/33c3/#/18


If anything, projects like these can be interesting time capsules in the future, both preserving the city itself and providing some clues about which landmarks were most detailed, and which parts of those landmarks were so detailed.

One thing that comes to mind is UC Berkeley's "Blockeley"[1] server a bunch of students built in the same vein. Some very specific parts of campus are insanely detailed; the V&A Cafe even has furniture where most buildings are hollow facades.

It's also interesting as a virtual meetup environment... at Berkeley, the official graduation this year was even held in the Minecraft server.

[1]: https://www.blockeley.com/


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: