fix #[pyclass] could not be named Probe#4794
Merged
LilyFirefly merged 1 commit intoPyO3:mainfrom Dec 12, 2024
Merged
Conversation
LilyFirefly
approved these changes
Dec 12, 2024
davidhewitt
pushed a commit
that referenced
this pull request
Jan 3, 2025
davidhewitt
pushed a commit
that referenced
this pull request
Jan 11, 2025
epontan
added a commit
to epontan/pyo3
that referenced
this pull request
Mar 17, 2025
Commit 603a55f ("fix `#[pyclass]` could not be named `Probe` (PyO3#4794)") fixed the issue where it was not possible to define a class named `Probe`. However, similar issue exists when trying to add `#[pymethods]` implementations to the `Probe` class. It generates similar confusing errors as the original issue (PyO3#4792), due to the internal `Probe` trait being in scope at the user code: error[E0782]: expected a type, found a trait help: you can add the `dyn` keyword if you want a trait object * | impl dyn Probe { Fix the issue by avoiding pollution of the imports from the macro expansion and instead use qualified path to the internal types.
epontan
added a commit
to epontan/pyo3
that referenced
this pull request
Mar 17, 2025
Commit 603a55f ("fix `#[pyclass]` could not be named `Probe` (PyO3#4794)") fixed the issue where it was not possible to define a class named `Probe`. However, similar issue exists when trying to add `#[pymethods]` implementations to the `Probe` class. It generates similar confusing errors as the original issue (PyO3#4792), due to the internal `Probe` trait being in scope at the user code: error[E0782]: expected a type, found a trait help: you can add the `dyn` keyword if you want a trait object # | impl dyn Probe { Fix the issue by avoiding pollution of the imports from the macro expansion and instead use qualified path to the internal types.
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 17, 2025
Commit 603a55f ("fix `#[pyclass]` could not be named `Probe` (#4794)") fixed the issue where it was not possible to define a class named `Probe`. However, similar issue exists when trying to add `#[pymethods]` implementations to the `Probe` class. It generates similar confusing errors as the original issue (#4792), due to the internal `Probe` trait being in scope at the user code: error[E0782]: expected a type, found a trait help: you can add the `dyn` keyword if you want a trait object # | impl dyn Probe { Fix the issue by avoiding pollution of the imports from the macro expansion and instead use qualified path to the internal types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
#[pyclass]could not be namedProbe.Closes #4792