PyO3 / pyo3

Rust bindings for the Python interpreter
https://pyo3.rs
Apache License 2.0
12.06k stars 744 forks source link

adding new getter for type obj #4197

Closed Cheukting closed 4 months ago

Cheukting commented 4 months ago

Adding new getter that works like __mro__ and __bases__ in Python.

closes #4192

Cheukting commented 4 months ago

Got it, seems we will roll back to the unsafe way to do it, right? @davidhewitt I will update this PR soon.

davidhewitt commented 4 months ago

Failure looks genuine:

  error: the item `FfiPtrExt` is imported redundantly
     --> src/types/typeobject.rs:163:17
      |
  3   | use crate::ffi_ptr_ext::FfiPtrExt;
      |     ----------------------------- the item `FfiPtrExt` is already imported here
  ...
  163 |             use crate::ffi_ptr_ext::FfiPtrExt;
      |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: `-D unused-imports` implied by `-D warnings`

  error: could not compile `pyo3` due to previous error

... seems like some of the FfiPtrExtr imports lower down in this file can probably just be removed now that we've added an import up the top.

Hooksie commented 4 months ago

Thanks for implementing!

Cheukting commented 4 months ago

@davidhewitt thanks! Will have a look at the unused imports

Hooksie commented 4 months ago

Adding some really small feedback on the expect message. Feel free to disregard if it's not important

Cheukting commented 4 months ago

Thank you @Hooksie