For the specification, I propose just to update isinstance() and issubclass(). And, for the implementation, I propose to migrate the _GenericAlias in core, that doesn't have a directly-accessible name or via alias in typing module. We will analyse the implementation later. Ok ? I can update the "Technical Point of Vue <https://github.com/pprados/peps/blob/pep-0604/pep-0604.rst#technical-point-o...>" to mention this, before the next PR. Philippe Le ven. 4 oct. 2019 à 10:16, Chris Angelico <rosuav@gmail.com> a écrit :
On Fri, Oct 4, 2019 at 4:54 PM Philippe Prados <philippe.prados@gmail.com> wrote:
In my current Proof of concept, I use PyObject*
typing=PyImport_ImportModule("typing");
and it's enough. At time, I am not an expert of all the source code.
From my understanding, the buildin type must be enough to use Python, without other modules.
Correct.
It is just a pure CPU code. If I'm right, to add the operator __or__() and to update the isinstance() and issubclass(), I must have the _GenericAlias accessible without other modules. I can not import the module typing in isinstance() otherwise an infinite recursion arrives. I use a "bad trick" to resolve this problem.
You're writing a language proposal. You can suggest whatever makes the most sense, such as creating a new builtin name, or creating a new core object that doesn't have a directly-accessible name, or whatever it takes. Just be specific as to what you _are_ proposing.
We can discuss further on the PR's comments if that's easier.
ChrisA