I'm a occasional hobbyist maker and i've used Autodesk Fusion, Solid Edge, OpenSCAD and other niche parametric programs, but always felt FreeCAD was too complex. But I really wanted it to work for me because it's FOSS and 100% offline. So with the new FreeCAD 1.1 RC I found an hour long tutorial and dove in.
(1.1 is supposedly much easier to work with)
After doing the tut I can say that 1.1 is very nice, i can uninstall Fusion and Solid Edge finally :)
I switched from Fusion to FreeCAD when I bid Windows goodbye (this video inspired me https://www.youtube.com/watch?v=VEfNRST_3x8).
Fusion does a LOT of stuff for you that FreeCAD doesn't - i.e. extrude a pad from two intersecting shapes in a sketch. While this is annoying at first I feel it forces me to design smarter.
I've had a few crashes and the constraint solver sometimes seems to behave weird and takes a ctrl+z and a second attempt at the same action to properly add a constraint but overall my experience has been pretty positive.
This shows a general problem that FreeCAD still has: Inside an initially off-putting and frustrating UI experience is a really good application trying to get out, but at the moment a new user still has to dig it out themselves.
For example, problems like this one. Or the confusing 3D navigation (switch to Gesture or TinkerCAD mode in the Settings), or the non-interactive view cube. And many other gotchas and paper cuts that can almost all be changed with a few clicks to make it more intuitive, or just more similar to popular competition (e.g. the OpenTheme add-on gets you that Fusion look you see in many FreeCAD tutorial videos).
It's a classic pattern with long-running FOSS projects. The authors get somewhat blinded to the pain because they're used to it, plus change is difficult for the established userbase. There's also a feeling that emulating competitors is surrendering one's own identity, and the idea that some of the rough edges are justified by "the powerfulness". Thus radically changing defaults, streamlining, simplifying and even just matching user expectations is often perceived as "taking the power away" and really difficult to have the daring-do to just do. Even though on the other side of the transition a much larger and happier userbase awaits.
A lot of FOSS projects eventually do mature to the point where they can pull this off, and I think there's real signs that FreeCAD is starting to get there. The upcoming 1.1 release has a ton of modern UI catch-up, such as on-canvas gizmos, and a few good defaults changes.
There's a lot more work to do, but like others I have the feeling that FreeCAD may well be approaching its Blender/KiCAD moment. I suspect becoming a contributor right now could be good fun.
I speak from experience! We've to some extent been on a similar journey with the Plasma desktop.
> It's a classic pattern with long-running FOSS projects. The authors get somewhat blinded to the pain because they're used to it, plus change is difficult for the established userbase.
Thanks for putting into words something I've definitely felt for a long time. It's like a junky old car with broken dash controls- you get used to having to bang on things to make them work, but if someone needs to borrow your car they're like "this is how you live!?".
Well said. It seems to me, many FOSS projects suffer from long time contributors which are extremely conservative and don't like any kind of change. Hence every new or improved feature becomes merely a setting (which barely anybody will discover) which is not enabled by default. The UX does only worsen this way because old cruft coexists with its replacement, settings grow fast, the combinatorial explosion of all feature combinations produces tons of bugs and new users will always be turned off by the first use experience.
To make the necessary overhaul, someone with the "power to decide" is needed, which is somewhat incompatible with unpaid open source development. I think this video about Audacity's redesign is informative in this regard:
Please be careful about voicing generic complaints in a discussion of a specific product. IMO, FreeCAD 1.0 took some huge leaps in ergonomics. I was surprised about how much work had been done. The workers behind FreeCAD don't deserve lazy sniping that doesn't even apply to their creation.
My guess is that they might appreciate specific criticism. It would probably help focus the work they are doing. But don't generalize them to have all the usual problems everybody else always seems to have. That isn't very helpful to anybody.
But I mean it. In my opinion, all the criticism of my post also applies to FreeCAD, not just other projects. Look what brought this up: a hidden feature someone wanted but wasn't aware of.
I'm not trying to blame anyone. I think this is a structural problem with FOSS projects in general (and it also applies to FreeCAD specifically).
I think freeopinion is right, though. I don't think "Make internals" is off by default only because the developers are conservative, but because the meaning and behavior of it changed a few times recently around the merger of the RealThunder forks and the TNP work. I did a casual search and 2025 comments are full of it doing nothing.
So a more productive specific thing would perhaps be indeed to strike up a "It seems to work nicely now, why isn't it default?" convo and maybe figure out the remaining bugs.
> So a more productive specific thing would perhaps be indeed to strike up a "It seems to work nicely now, why isn't it default?"
That may be. It's just not what I'm interested in. I don't have the energy to fight lots of little battles to improve some minor things, when – in my perception – the end result would still *suck. I think a major rework is needed. For example, I don't think simply enabling "Make Internals" would be the best thing to do. IMO it should be always on AND the setting should be removed AND the toggle from the data view should be removed AND that would imply that it must always work bugfree so that nobody has a need to disable it. I don't think this is ever gonna happen if I start a discussion or even make a pull request.
* I'm not a hater, I'm a FreeCAD user. Out of all the offerings that exist, it's my preferred CAD tool for my private hobby use. I just wish it was better, because I see untapped potential.
Vision is overrated if it’s not solving users’ problems. Software with a vision is kinda the bane of the industry right now (macos tahoe, copilot, windows 11,…)
> The authors get somewhat blinded to the pain because they're used to it, plus change is difficult for the established userbase. There's also a feeling that emulating competitors is surrendering one's own identity, and the idea that some of the rough edges are justified by "the powerfulness". Thus radically changing defaults, streamlining, simplifying and even just matching user expectations is often perceived as "taking the power away" and really difficult to have the daring-do to just do. Even though on the other side of the transition a much larger and happier userbase awaits.
I think it is unfair to say that they are "blinded to the pain". They are well aware of it from what I've seen of the Dev discussions on Discord. But the vast majority of the devs are volunteers so they can only do so much so fast. There are also some very nice usability improvements as of late that borrow from other programs, like the Solidworks-style navigation settings and the on-screen draggers for pad / pocket / transform type operations. Yes there are tons of preferences and some of the defaults might not be great, but they've added a "Search Preferences" field to help sort through them all. Then there are issues like in the link below where the discussion of how to improve FreeCAD considers comparisons with other pieces of software.
Another point I'll add is their creation of a Design Working Group to help sort through usability issues and generate a consensus for devs to subsequently implement.
I would think it would be beneficial to the companies that make 3D printers and CNC machines to help fund some of these efforts... I've found it often takes the input of commercial interests to get general UX improvements into open-source.
ex: really impressed with the direction of Audacity as an example, though I can also understand why a given community would reject such influence from a single org.
> I think it is unfair to say that they are "blinded to the pain".
I mean it more in the sense that it's very difficult to truly conceive of what a new user of the app would stumble over or dislike, if you're very used to it yourself.
Often that means small things that would not be that hard to address become invisible, because there's obvious higher priorities. Other times, things are considered small fries that actually are consistently wrong and need a holistic re-think.
One of the best things to do is to actually watch novice users use your software. This was also a big boost to the "Blender moment", when the Blender studio started inviting over artist and just watched them work in the software. This used to be really hard to do, but has now become a bit easier with screencasting and conferencing tools. I bet FreeCAD is also starting to do more of this.
Thanks for adding additional info! I forgot to mention the Design Working Group as another sign. In KDE we also set up a similar "Visual Design Group" years ago that was behind a lot of the improvements.
But there's also potential downsides to digging in and fixing the UI.
For instance: I've made a few simple boards with KiCAD. The first one was frustrating as hell and took forever, because my distro had helpfully installed the very latest version of KiCAD.
Meanwhile, the tutorials and videos were generally all about older versions. Which is fine, I guess, except way too many of them didn't even specify a version number.
So I (a complete newb) spent way too much time trying to find nonexistent UI widgets and being mystified that a given tutorial often seemed to be written by someone who was using different software entirely.
(The answer here is, of course, to have decent-enough official tutorials that stay in lock-step with software releases, so as to always get people started on the right page. But doing/enforcing that feels like work, and that's not usually what people want to feel when they volunteer to help write CAD software.)
i like the way prusaslicer has a conspicuous setting to enable intermediate and advanced settings so that users can start with a less intimidating setup and opt in to the bells and whistles if and when they are ready.
It would be interesting if FreeCAD could iterate towards something that is also easy for agents to use. I have seen cases of people doing this with Blender.
I too feel like the latest versions are quite a big improvement and I finally lost that feeling of slowing myself down just for the sake of using OSS.
But I still hope for a "blender moment" where a concerted effort gets rid of old cruft, improves UI/UX and jump-starts growth (also in developers/funding) and further improvements.
It's probably impossible for FreeCAD to catch up with the industry-standard CAD systems (SOLIDWORKS, NX, Fusion) unless they somehow pour a stupendous amount of money into their geometry kernel [1].
All major CAD systems use mature geometry kernels like Parasolid [2]. Parasolid was developed for 40 years and is still in active development. This is the piece of code that enables CAD systems to do things like computing an intersection of a G3 smooth fillet with embossed text, handling all corner cases.
FreeCAD runs on OpenCASCADE [3], which is both less sophisticated today and is slower to gain new features than Parasolid, being seemingly maintained by one person [4]. FreeCAD's geometry is hard limited by what OpenCASCADE can do.
This is the main difference from Blender. Blender ultimately operates on vertices, which doesn't require nearly the same level of inherent complexity. Blender isn't bottlenecked in what it can do like FreeCAD is.
You are correct in that OpenCASCADE is less refined than parasolid, but I would argue that most people just don't need it. Practically, FreeCAD is fit for all purposes, except those for which you require knowledge of what a geometric kernel even is, and then you know who you are and how to serve yourself.
It feels like all those 3D modeling apps like 3DSmax,Fusion even Zbrush share like 90% of their feature set but your are forced to literally juggle(for videogame dev at least) because of one or two arguably extremely niche capability.
It may look like they're all easily interchangable because the UI and actions are similar (you have a viewport and can do extrudes, etc..) but fundamentally, they're all working on very different objects at their core. Blender and 3DS Max are the most alike, but Zbrush is an entirely different paradigm and so is parametric CAD. An extrude in Blender is massively different from a pad in FreeCAD.
Maybe, with a ton of time and effort the blender UI could be abstracted from most of the box-modeling approach and then pasted over a different paradigm, but It'd take tens of thousands of hours I imagine,.
You can do sculpting in Blender as well as parametric objects, similarly you can emulate most of substance designer with shaders, maybe just not _quite_ good enough that's the thing.
It feels like we have been so so close to an unified 3D content creation tool kit for many years now!
>> I kinda wish blender could just do CAD honestly
Have you tried the "CAD sketcher" add-on? I think Blender should have similar functionality built-in, but for now this looks like a nice add-on.
Blender is a very very long way from being used as a general purpose CAD tool, and IMHO it should not strive to be that. But having this ability to do simple CAD designs without opening and learning a different program is cool.
Yeah, I avoided Fusion (etc.) because of the usual bait-and-switch I've seen with commercial applications that claim to be "free" at some point. If I'm going to invest in learning a new application, I'd rather it be an open one.
I dove into FreeCAD with either version 1.0.0 or earlier. It was… rough.
To be sure, it was a whole new app so I expect initial navigation around the app to be challenging. But, wow.
Nonetheless, I did get a few things modeled up [1]. And for that I have to thank LLMs for steering me through using the app. I suggest others to try an LLM as a guide if you are learning (and I still am learning, of course). I like tutorials, but so often you can spend hours watching tutorials that cover all manner of ground where you simply want to complete a specific task—unable to find the tutorial covering how to do it.
Having said that though, I am eager to try this 1.0.2 version. (I'm also eager to fix a few minor MacOS-specific nits that I've already seen.)
I've spent a decent amount of time on the FreeCAD Discord and more than one advanced user on there suggests treating FreeCAD like a rolling release. So I've been using the weekly FlatPack builds and have had a great experience. FreeCAD has been taking some big steps recently and by sticking with 1.0.0 / 1.0.2, you're basically missing out on almost a year's worth of improvements.
And the tutorial by Mango Jelly Solutions on YouTube are fantastic. They are generally very focused on one particular task per video so I think you'd find them really useful.
I find SOLIDWORKS for Makers [1] a great middle ground between bait-and-switch "free" Fusion and the real, very expensive, deal. SW is one of industry standards, its interface is much better than FreeCAD's, and it's more powerful than both FreeCAD and Fusion. For example, both FreeCAD and Fusion struggle with G2/G3 smoothness [2] where SW doesn't even blink. Fusion doesn't allow to pattern features on sketch points (it's gated behind an expensive add-on [3]) when it's a built-in feature in SW.
Subscription-based, cloud-based. That's two strikes.
It sounds like Solidworks is better for someone who is always using it—I maybe use a 3D CAD tool two or three weeks out of the year. Rent-anxiety (paying for it but not using it) keeps me from subscription apps.
One is cloud based one is local install.
They are pushing cloud based one because, their local installer is really bad (it's also bad for commercial version, people often joked, that the hardest thing about SW is getting it to run)
But yes, you pay yearly subscription.
Which I am not a fan of, but it's a decent price, and I understand that such niche programs, can't sustain themselves on volume
> If I'm going to invest in learning a new application, I'd rather it be an open one.
I wouldn't worry about it too much. The concepts are very transferrable.
At work I used to use SolidWorks exclusively, now I'm using Onshape and will probably switch to Inventor soon. At home I typically use Fusion 360. They all work more-or-less the same and moving between them isn't too hard.
Have you tried SolveSpace? It's easily my favorite open source CAD program. The main things it's missing are shells, fillets, and chamfers. But I've been able to 3D print quite a few parts using it!
You might want to check out Dune3D. It advertises itself as combining the constraint solver from SolveSpace with a OpenCASCADE geometry kernel supporting fillets and chamfers. :)
Haven't used it much apart from some minor tests (I tend to prefer MoI3D, but that's in a different category in several ways...), but as far as FOSS solid modelers it seems like the most promising to me.
I do remember some small UI quirks, but overall it felt very approachable and streamlined, and looking at the GitHub repo, development is active. FreeCAD IMHO is just too sprawling and complex, with seemingly little tought paid to UI/UX.
Agreed: The Dune3D developers made the wise decision to start from scratch implementing a parametric modeling UI. Extremely robust software; very fast, and almost intuitive (high praise for CAD).
The problem with FreeCAD, on the other hand, is that it's a "just two more weeks and it'll be great" solution.
The developers are clearly talented in a raw-math kind of way, but FreeCAD offers the eternal promise of usability in the next release; while never delivering it.
Those who are profoundly cynical might consider the possibility that the legacy CAD industry has infiltrated the FreeCAD development team and run Pied-Piper ops there to prevent a Blender-moment stealing their revenue.
This would perfectly explain why the FreeCAD experience is so consistently bizarre.
>Those who are profoundly cynical might consider the possibility that the legacy CAD industry has infiltrated the FreeCAD development team and run Pied-Piper ops there to prevent a Blender-moment stealing their revenue.
If you've been around on the FreeCAD forums, you'll see that the majority of users essentially believe that all comparisons of FreeCAD with commercial CAD software is illegitimate and become incredibly defensive. They have developed a huge arsenal of coping strategies to avoid improving FreeCAD and the results speak for themselves.
It's like they've got the Steve Jobs attitude but without the good taste that justified it.
>They have developed a huge arsenal of coping strategies to avoid improving FreeCAD and the results speak for themselves.
Exactly. These FreeCAD "strategies" you mention align themselves perfectly with the objectives of the legacy CAD industry: To delay; break; and obfuscate opensource CAD.
In other words: The FreeCAD team may not be infiltrated by the legacy-CAD industry, but its behavior is entirely consistent with such a state.
One solution is to fork the behemoth; but if FreeCAD is a hedge-maze-by-design, the only way to win is not to play the game: Build alternatives elsewhere, from scratch.
FreeCAD feels like a time-drainer honeypot. Though whether by accident, or malice, is unknown.
Meh, if you gauge FreeCAD development mindset off of the forums you are misleading yourself. That was certainly the case 3 or 4 years ago, but it would seem that the core contributors have mostly moved away from the forum as a platform due to the very toxic mentality you mention. GitHub is the most concrete view into things, and a lot of free-flowing discussion happens on Discord.
The mindset against usability improvements that was prevalent back then has largely shifted. The hard part is the complexity of the program makes a single sweeping overhaul incredibly unlikely so incremental jumps and improvements will probably continue. Seems to me like things are headed in a pretty healthy direction when comparing the last few versions.
This. I just can’t bring myself to use FreeCAD for anything. It’s been almost a decade of occasional attempts during vacation breaks and it is still one of the worst, most counter-intuitive pieces of 3D software I’ve ever used (and I paid my way through college doing early multimedia work, some 30 years ago).
I was excited about dune3d but one of the things I needed to do I had to import an SVG as a path to extrude (or similar) and I couldn't see a way to do it.
I managed to do it (painfully) with freecad, so that's what I settled with.
Solvespace is nice, but missing fillets and chamfers is kind of a deal-breaker. Last time I tried it it also had issues with small holes turning into diamonds.
That said, pre-1.0 FreeCAD had a terrible UX so it was the best FOSS CAD option.
With the 1.0 release of FreeCAD the UX is much better though. There are still a few WTFs (e.g. it took me quite a while to figure out rollback is done via right-click->set tip, or something like that)... But overall it's better than Solvespace now.
Set tip makes sense if you think of the steps taken to build up a parts as a history. Setting the tip isn't a rollback. It is saying "I want to insert a new step in the history".
Yeah I actually have. I really liked the concept, but I designed a cylinder with many holes (think a robust sieve) and it just crashed when the number of holes grew too great. Even the OpenCL/MP version. I felt it being unstable in other ways too so I did not make it my go to tool. Sadly it also seems it's not being developed much.
EDIT: Missing fillets and chamfers we're also a big problem for me - probably I'm just a newbie maker and want unreasonable things, but still.
FreeCAD is one of those programs that I want to like and I’m rooting for, but for modeling outside of work I’m a much bigger fan of plasticity and blender. I’m hopeful now that language models are so good at software development that we can get a fork of freeCAD with a focus on ease of use.
Unrelated to part modeling, I would love to have a browser based roadway design tool that is domain-first, CAD second. Autodesk and Bentley are trying to be less bad, but their solutions create an extremely high administrative burden and unreasonable costs. Oh, if I just have someone working full-time for a month preparing files to be federated on your cloud platform I can finally get clash detection? I mean, shouldn’t that be table stakes for the software you are already being asked to buy over again every single year?
For me, as a beginner in Freecad and 3d modelling I kept being unable to interpret/remember all the tool icons, and remember the shortcuts while learning.
I found this command palette that helped me discover the different commands and actually get to (beginner) proficient.[0].
Again, no relation, but it's what made it stick for me after a few aborted learning attempts. (and I had a lot of fun with freecad! Especially by my second or third model where I could actually just sit down and start modelling without having to learn any extra things. Now I just need an excuse to find something else to model...)
Similar experience. I tried to learn FreeCAD a while ago. People recommended Mango Jelly's tutorials. I used those among others and dove in. However, it was a pretty frustrating experience. Things never worked quite right. I would drill into a certain point and then realized you couldn't get there from here, and had to start over.
I recently had a desperate need to 3D print a part and tried FreeCAD again. A couple of things changed: 1) 1.1 came out and 2) Mango Jelly created a playlist that essentially was "bare bones what you need to know to get started." It was slightly over an hour of the fundamentals of navigating and just enough tools.
I think FreeCAD was basically just way too buggy initially, especially on macOS. Things never worked like tutorials said, or even dot updates sometimes broke what was being taught in tutorials. Also, while great, MJ's other previous videos deep dove into specific tools. Over half of any particular video would discuss features that helped you become an expert, but overwhelming when it came to getting up and running.
Since then, I've felt much more confident about FreeCAD and have used it to knock out other pieces.
Yeah the tutorial I linked was from Mango Jelly for FreeCAD 1.1 :) He seems to have a perfect balance of getting it done, and you understanding what you are doing.
His latest 1.1, 1 hour tutorial does. It's great - basic tinkering and explaining philosophy behind things. It really set you up to explore on your own to get you the remaining 20%.
His previous ones were geared for making you an expert. I remember thinking, "I'm not watching a week's worth of videos to make a hollow box with holes around it."
I've been treating FreeCAD like a rolling release by using the weekly Flatpack builds and it has been a pretty good experience so far. Based on a good model I was given as a starting point and a lot of Mango Jelly Solutions videos, I've developed a detailed model of the Virtual Pinball machine I'm building now. It has been huge in saving me from countless mistakes in the actual build.
Yeah I still consider Solid Edge very good. Easy to work with, does not require internet, no stupid limitations (like the 10 model limitation for Fusion). Many tutorials, etc. But still, they might revoke their free license at any moment and I am out of a tool, and wasted experience.
This. 1.0 and 1.1 are monumental improvements over the decades of releases that came before.
I struggled through the earlier releases and now I use OnShape because I can seamlessly switch between work and personal computers. If I ever can drop that requirement I'd love to go back to FreeCAD now that it's "good".
I got to use SolidWorks, Catia, Inventor before having my hands on pre-1.0 versions of FreeCAD. I never really understood the argument that it's too complex. The UI may be what it is (and admittedly full of shortcomings), but I found FreeCAD to be very conventional in the sense that you build out of sketches, define constraints that are identical from every other tool, compose those through extrusions, revolutions, etc.
The fact that it crashed on me for everything and nothing all at once seemed a bigger problem than "complexity".
I've also dove into all of those, and have mostly stuck to OpenSCAD now. I'm not amazing at it, but I've been able to get a few things done that I needed for 3D printing. What has really made much better at OpenSCAD is ClaudeCode or Antigravity in VSCode, with BSOL2 library. The documentation is just bad enough that it takes me forever to figure out on my own, but just good enough with lots of examples out there that an LLM can get mostly what I want with little fuss.
I want to like FreeCad, or FOSS CAD. For example: KiCAD and Blender are exquisite Free/OSS software I'm proud to use. For [non-EDA] CAD, I use SolidWorks, as I find FreeCAD (and OpenSCAD) is not in the same quality and user-experience tier.
Because stocks have a tendency to go up even when they should be going down. And when you decide that it probably isn't going down, it will go down. Timing the market isn't a reliable way of wealth generation. Long term investing is.
Currently it seems that Google is pushing for hardware attestation, so you might be able to install Graphene/Lineage if your phone manufacturer allows you to unlock your bootloader, but many Play Store apps won't work as they'll detect your root. It's actually gotten pretty insane how every low-value app considers themselves the centre of the world and unable to run on a rooted device.
Example: the loyalty card app for a local store chain - there's no money in it, I can just get some discounts when I use it. So an attacker would have to steal my phone, somehow unlock it, and then they can use my loyalty card (btw which is free to obtain for anyone and there are no tiers) to get some discounts. And for that, they have implemented a pretty decent root checker which i had to put in some effort to overcome. And there are many more like it.
There might be insurance and bank contracts higher up the chain that classify it as a financial dealing and thus require stricter conformance. I'm speculating tbh I have no idea for sure.
That's also a large part of the issue IMO. I currently _have_ root on my rooted and Lineaged Poco F3. But as hardware attestation is becoming the norm I am deeply worried about the future. I have been a pretty eager Android fan due to its achievable-if-savvy openness. If I lose root and sideloading, then Android is dead to me. There would be nothing valuable in it, just another corporate walled garden.
My HSA just implemented some bullshit where even the web interface requires a near-new phone to even log in. For now I'm just switching HSA providers rather than buying a new phone. I'm also worried about the future.
People are free to rip their purchased media. He even says that he buys blurays/dvds in the article.
One can assume anything, but a completely legal setup can look exactly like that. Especially as most of those are relatively old movies - looking like a list of purchased blurays/dvds to me.
It's entirely possible to populate a media tree of movies and shows with stub zero length files, just the formally named movie or tv episode names, and have Kodi and other other media managers download all the meta data (posters, descriptions, cast, etc) to sideload in the media tree or maintain in their own internal databases.
It's useful for testing and debugging media software in addition to being a great way to browse through all the films with ActorX or all the movies in a genre or a year.
You get the same visuals flipping through Kodi with and only lack something happening when you press play (unless you populate with named files that all hardlink to that Rick Astley music video).
> pyrefly, mypy, and pyright all assume that my_list.append("foo") is a typing error, even though it is technically allowed (Python collections can have multiple types of objects!)
> If this is the intended behavior, ty is the only checker that implicitly allows this without requiring additional explicit typing on my_list.
EDIT: I didn't intend my comment to be this sharp, I am actually rooting for ty to succeed :)
ORIGINAL: I am strongly against ty behaviour here. In production code you almost always have single type lists and it is critical that the typechecker assumes this, especially if the list already has same-type _literal_ items.
The fact that Python allows this has no bearing at all. To me having list[int | str] implicitly allowed by the typechecker seems like optimizing for beginner-level code.
In this particular example, we are tripped up because ty does not do anything clever to infer the type of a list literal. We just infer `list[Unknown]` as a placeholder, regardless of what elements are present. `Unknown` is a gradual type (just like `Any`), and so the `append` call succeeds because every type is assignable to `Unknown`.
We do have plans for inferring a more precise type of the list. It will be more complex than you might anticipate, since it will require "bidirectional" typing to take into account what you're doing with the list in the surrounding context. We have a tracking issue for that here: https://github.com/astral-sh/ty/issues/168
I hope I didn't come off as angry or anything, I was just very surprised by the behaviour :)
I am talking from some experience as I had to convert circa 40k lines of untyped code (dicts passed around etc) to fully typed. IIRC this behaviour would have masked a lot of bugs in my situation. (I relied on mypy at first, but migrated to pyright about 1/4 in).
But otherwise it's good to hear that this is still in progress and I wish the project the best of luck.
So, how does that relate to this quote from the article?
>ty, on the other hand, follows a different mantra: the gradual guarantee. The principal idea is that in a well-typed program, removing a type annotation should not cause a type error. In other words: you shouldn’t need to add new types to working code to resolve type errors.
It seems like `ty`'s current behaviour is compatible with this, but changing it won't (unless it will just be impossible to type a list of different types).
You could have a `list[int | str]` but then you need to check the type of the elements in the list on usage to see if they are `int` or `str` (if you are actually trying to put the elements into a place that requires an `int` or requires a `str` but wouldn't accept an `int | str`...).
If your code doesn't do that then your program isn't well typed according to Python's typing semantics... I think.
So you can have lists of multiple types, but then you get consequences from that in needing type guards.
Of course you still have stuff like `tuple[int, int, int, str]` to get more of the way there. Maybe one day we'll get `FixedList[int, int, int, str]`....
We haven't decided yet if this is what we want to do, though. It's also possible that we may decide to compromise on the gradual guarantee in this area. It's not an ironclad rule for us, just something we're considering as a factor.
Well ours is not yet implemented, so it's too early to say whether they're compatible. :-)
But less snarkily, we do talk to them often (and the authors of other tools like mypy and pyright) to make sure we aren't introducing gross incompatibilities between the different type checkers. When there are inconsistencies, we want to make sure they are mindful rather than accidental; for good reasons; spec-compliant; and well documented.
I don't think it's optimizing for beginner-level code, I think it's optimizing for legacy code. Introducing a type checker to a large existing untyped codebase is a big lift, but becomes less of one if almost all existing code is accepted.
Well then support an option to enable that kind behaviour? Make it an explicit decision by the devs. I think running in a type error and then adding an exception to your config is safer than silently pass and only learn about the mixed types in a production bug
I think this should be handled by a type assisted linter not typechecker.
Imo a type checker in a dynamic language should is primarily there to avoid runtime errors. In a list with multiple types the typechecker should instead force you to check the type before using an element in that list.
If you want static types python is the wrong language
list[int | str] might usually be a mistake, but what about
my_list = [BarWidget(...), FooWidget(...)] ?
my_list.append(BazWidget(...))
my_list.append(7)
Wouldn't it be nice if the type checker could infer the type hint there, which is almost certainly intended to be list[Widget], and allow the first append and flag the second one?
The problem with the pyrefly behavior is that if you have a large codebase that isn't using any sort of Python typechecking, you can't just adopt this tool incrementally. You have to go fix up all of these issues. So you need to get widespread support for this migration.
For an internal tool at Meta, this is fine. Just make all your engineers adopt the style guide.
For introducing a tool gradually at an organization where this sort of change isn't one of the top priorities of engineering leadership, being more accepting is great. So I prefer the way ty does this, even though in my own personal code I would like my tool to warn me if I mix types like this.
>The fact that Python allows this has no bearing at all. To me having list[int | str] implicitly allowed by the typechecker seems like optimizing for beginner-level code.
Yes, lets base our tooling on your opinion rather what is allowed in python.
I am strongly for ty's behaviour here. working python code should not raise type errors unless the user explicitly opts in to a more static subset of the language by adding type annotations.
Because to me this seems like a fantastic example of a highly possible mistake that a typechecker _should_ catch. Without defined types in this situation a couple of things could happen: 1) it gets printed or passed to some other Any method and the typechecker never yells at you and it crashes in production 2) the typechecker catches the error somewhere long down the line and you have to backtrack to find where you might be appending a str to a list[int].
Instead it could mark it as an error (as all the other checkers do), and if that's what the user really intended they can declare the type as list[str | int] and everything down the line is checked correctly.
So in short, this seems like a great place to start pushing the user towards actually (gradually) typing their code, not just pushing likely bugs under the rug.
It depends on what happens with the list after that. Are there int specific operations applied or it is just printed? What if it is fed into objects with a str attribute where the ints could be cast to str?
I don't know. I would argue that since type checking in python is optional, the type checkers shouldn't care unless the programmer cares. A more interesting case would be my_list.append(2.45) or my_list.append(Decimal("2.0")). Those cases would be "numbers" not just "ints".
In the real world, a row of CSV data is not type checked -- and the world hasn't pushed the spreadsheet industry to adopt typed CSV data.
After doing the tut I can say that 1.1 is very nice, i can uninstall Fusion and Solid Edge finally :)
The guide i followed, no relation to it whatsoverer https://www.youtube.com/watch?v=wxxDahY1U6E