Some APIs return std::optional<Token> and others return Token knowing that they will be nullable-ish. In the Python bindings, we should specialize nanobind::type_caster<std::optional<::pasta::Token>> and nanobind::type_caster<::pasta::Token> to present both as Optional[Token].
Some APIs return
std::optional<Token>
and others returnToken
knowing that they will be nullable-ish. In the Python bindings, we should specializenanobind::type_caster<std::optional<::pasta::Token>>
andnanobind::type_caster<::pasta::Token>
to present both asOptional[Token]
.