Skip to content

First steps towards native subclassing #5679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

coolreader18
Copy link
Member

Not very ergonomic yet, and there are definitely some soundness holes atm, but I aim to fix those in a follow-up.

@coolreader18 coolreader18 force-pushed the native-subclassing branch 2 times, most recently from 4ba88a8 to 4d276ea Compare April 9, 2025 03:36
@coolreader18
Copy link
Member Author

The cspell errors seem to be a false positive, since it's flagging words that were there before this PR.

@arihant2math
Copy link
Collaborator

Yeah it does that a lot. I'll send a pr in to fix it.

@youknowone
Copy link
Member

cspell action's incremental check option doesn't look working that good

@arihant2math
Copy link
Collaborator

Probably because it checks the entire file instead of just the changes (from what I see).

@arihant2math
Copy link
Collaborator

The issue is it runs this command, which fails sometimes:

Error: Error: Command failed: git diff-tree --no-commit-id --name-only -r 8dc17180029337676395154fc33b513678ea4a8f eb2d2a8b7b4290f893cd352341530e5c3f0339bc

@@ -172,7 +172,7 @@ mod _bz2 {

#[pyattr]
#[pyclass(name = "BZ2Compressor")]
#[derive(PyPayload)]
#[derive()]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty derive?

@@ -266,8 +266,8 @@ def LoadLibrary(self, name):

cdll = LibraryLoader(CDLL)

test_byte_array = create_string_buffer(b"Hello, World!\n")
assert test_byte_array._length_ == 15
# test_byte_array = create_string_buffer(b"Hello, World!\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intended?

if let Meta::NameValue(syn::MetaNameValue {
value:
syn::Expr::Path(syn::ExprPath {
qself: None, path, ..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add qself to rust-more.txt

///
/// # Safety
///
/// `type_id` must be accurate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand wrong type_id can cause a bug, but not sure how it can make unsafety. Do you have a scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants