Jij-Inc / pyo3-stub-gen

Stub file (*.pyi) generator for PyO3
Apache License 2.0
39 stars 5 forks source link

Feature: Support HashMap<_, _, ahash::RandomState> #54

Closed cauliyang closed 4 weeks ago

cauliyang commented 4 weeks ago

I am wondering if we can support HashMap<, , hash::Random State> from https://docs.rs/ahash/latest/ahash/. pyo3 supports this type as well. BTW, thanks for your effort, and the library's really helpful!

error[E0277]: the trait bound `HashMap<i64, char, ahash::RandomState>: PyStubType` is 
not satisfied
   --> crates/deepbiop-fq/src/python.rs:457:15
    |
457 |     id_table: HashMap<i64, char>,
    |               ^^^^^^^^^^^^^^^^^^ the trait `PyStubType` is not implemented for `
HashMap<i64, char, ahash::RandomState>`
    |
    = help: the trait `PyStubType` is implemented for `HashMap<Key, Value>`

error[E0277]: the trait bound `HashMap<std::string::String, Predict, ahash::RandomStat
e>: PyStubType` is not satisfied
    |
459 | ) -> Result<HashMap<String, Predict>> {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyStubType` is not implemented 
for `HashMap<std::string::String, Predict, ahash::RandomState>`, which is required by 
`Result<HashMap<std::string::String, Predict, ahash::RandomState>, anyhow::Error>: PyS
tubType`
    |
    = help: the trait `PyStubType` is implemented for `HashMap<Key, Value>`
    = note: required for `Result<HashMap<std::string::String, Predict, ahash::RandomSt
ate>, anyhow::Error>` to implement `PyStubType`

For more information about this error, try `rustc --explain E0277`.
termoshtt commented 4 weeks ago

Added in #55 , and released as 0.5.2. Thanks feedback!

cauliyang commented 4 weeks ago

Thanks very much!