JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
88 stars 4 forks source link

Use Python data model in context #444

Open JSAbrahams opened 1 year ago

JSAbrahams commented 1 year ago

Current Issue

Now that we have more fully implemented generics, we can leverage this logic to more fully implement the datamodel of Python. This means that when calling methods, we check the loaded Python classes instead of implementing special logic in the type checker. We then match methods and their types.

High-level description of the feature

Call the proper magic methods of Python. We already make use of for instance:

Up until now, this was done on a as-needed basis. However, a more exhaustive implementation is possible now thanks to the now more comprehensive generic implementation.

Description of potential implementation

See https://docs.python.org/3/reference/datamodel.html for method and function names.

JSAbrahams commented 1 year ago

A general issue working forward, should be split into constituent components since implementing this all at once is a bit much.