◐ Shell
clean mode source ↗

Fix `best_base` to select proper base class by Snowapril · Pull Request #5324 · RustPython/RustPython

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get how this is intended to be used yet. How to handle it if it requires multiple fields?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not intended for multiple types to be declared with itemsize.
In the pyclass code, if the number of types declared with itemsize is not one, it is planned to raise an error in a way that developers can understand. Unlike basicsize, it seems difficult to automatically infer item type for each class delcaration, so I have chosen this way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. I think itemsize implementation is better to be moved to other PRs. It seems it does not cause wrong behavior in best_base.