Hi,
Am 1. August 2021 00:56:22 MESZ schrieb Blue:
>In the Pyrex syntax I can declare an attribute as following:
>
> cdef str username
>
>But Cython does not expose a `cython.str` (only `cython.basestring` and
>`cython.unicode` as found in Shadow.py). So would the above become
>`cython.unicode` (see the following)?
>
> username: cython.unicode
If you want str, use str. The two cython.* types are only provided because Py3 does not have them.
>Another question, how are typehints handled when Pure Python mode is used?
>Obviously not all typehints can be used to Cython's knowledge, so how does
>Cython pick which ones to utilize? Are only typehints under the `cython`
>namespace utilized?
No, anything out understands will be used. Die everything else, you get a warning.
>Any place in the source I can be redirected to read about this? I've been
>meaning to get to know the project better :)
Don't have my laptop right now, but look out for annotation_as_type and analyse_as_type.
Stefan