You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The best explanation I've found is this message from Martin von Loewis. There are a few messages after that where people are trying to come up with a solution, unfruitfully; after that the discussion degenerates into a flame war about C++.
I'm actually still not sure what we could do differently in the 4.0 API -- make it const * const * keywords?
It explains why char ** cannot be implicitly converted to const char **, but not why it cannot be implicitly converted to const char * const *. And in C++ (which in general is more strictly types than C) such implicit conversion is supported. Why it does not work in C? The answer is because. The C rules are simpler than the C++ rules, so they did not bother to add special rules for such implicitly conversion, even if this causes some inconvenience in practice. I only hope that they will change this in future versions.
I think that we can fix this in C++ in compatible way, but for C we can only provide a lever to chose between const char * const * and char * const * (the latter is compatible with char **). It could also make transition to future incompatible C API (if we decide to break it) simpler.
See python/cpython#65210.
The text was updated successfully, but these errors were encountered: