Object and Type Unification
Posted by Simple-Soil-7468@reddit | Python | View on Reddit | 8 comments
Have had a conversation with ChatGPT about the wildest and craziest idea about unifying `object` and `type` into a single entity that has the combined functionality of both. Essentially the equivalent (at the lower level) of doing `class MyEntity(object, type)`.
I'd love to know how stupid of an idea this is. I agree it will never happen, and I overly argued the point as shown in the conversation because I wasn't getting very creative/accurate responses.
To me this is just a cool 'what if'. What if they were? How much of a mess would the interpreter code be to actually physically do it?
More importantly, is it physically possible to unify them, with reasonable backwards compatibility ensured (obviously something nuanced like `assert hasattr(type, "__class__")` would be impossible to unify).
Roast me please
james_pic@reddit
Doing this in Python is probably not possible, at least not without literally everything breaking.
Although note that
type
is already a subclass ofobject
. Everything is an object, including types, sotype
already has all the functionality ofobject
.What you describe sounds a lot like prototypal inheritance, which, whilst not supported in Python, is used in JavaScript, for example.
Simple-Soil-7468@reddit (OP)
This is super interesting! I will definitely look into this. I have never heard of a language that could bypass classes like that, I thought they were foundational. This post was a thought experiment and I'm glad I could learn something.
Sbsbg@reddit
I also tried to have a conversation with ChatGPT. It didn't work at all. The AI tools don't have that capability yet. If you expect any intelligent answers it's even more distant.
Nothing wrong with asking what if for a lot of questions, but if you expect anything productive out of it you better have that discussion with real humans for now.
Any language model AI just strings together words that have a high probability to fit together. It understands nothing at all. IQ zero in other words.
Jmc_da_boss@reddit
And you thought this was worth posting why? Absolutely no one gives a shit what the language model spits back out. What an insane thing to post
illuminanze@reddit
I'm sorry, but why would you ever want to do this?
_Answer_42@reddit
Maybe he mean something like in Ruby where you can do: 10.to_float ?
HommeMusical@reddit
This transcript is almost unusable on Firefox and Chrome.
See this: https://imgur.com/a/ptkq26D
The input text is in a tiny box inside the window, which cuts of most of the text, and there's no way to resize that box to show all the text - you need to scroll sideways, as much as a dozen times, to read the prompt.
This doesn't reassure me as to the quality of the content!
ChatGPT is wrong when they say it would introduce a circular dependency - what would happen is that
type
andobject
would become the same type.First question: why? What possible benefit would this offer?
Second question: how? How exactly do you convince
object
to sometimes act liketype
?I think question 1 is unanswerable - there is no good reason to do this, particularly given that there aren't any great answers to question 2 either.
This whole thing seems like a big time waster for no possible advantage.
fortunatefaileur@reddit
It is indeed very stupid to ask a LLM about open ended technical topics, yes.
The unification mostly happened in 2001: https://www.python.org/download/releases/2.2/descrintro/