Skip to content
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

sip.voidptr handles integer values and sequences #104

Merged
merged 4 commits into from
Oct 4, 2020

Conversation

altendky
Copy link
Collaborator

@altendky altendky commented Oct 4, 2020

No description provided.

@altendky altendky mentioned this pull request Oct 4, 2020
3 tasks
PyQt5-stubs/sip.pyi Outdated Show resolved Hide resolved
Copy link
Collaborator

@BryceBeagle BryceBeagle left a comment

Choose a reason for hiding this comment

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

I'm not entirely convinced that voidptr.__init__ doesn't have some magic going on behind the scenes allowing it to have a self-less __init__. Maybe it does something very strange with CPython, or with __new__.

Also, I tried looking through the sip source for this class and I have no idea where it is, or how it's generated, so that was a bust.

I think we should document this change so we can ask about it in the future. Can it be added to the changelog?

@altendky
Copy link
Collaborator Author

altendky commented Oct 4, 2020

Without claiming that I now think I know what's up...

>>> help(sip.voidptr)
Help on class voidptr in module PyQt5.sip:

class voidptr(builtins.object)
 |  Methods defined here:
 |  
 |  __bool__(self, /)
 |      self != 0
 |  
 |  __delitem__(self, key, /)
 |      Delete self[key].
 |  
 |  __getitem__(self, key, /)
 |      Return self[key].
 |  
 |  __int__(self, /)
 |      int(self)
 |  
 |  __len__(self, /)
 |      Return len(self).
 |  
 |  __setitem__(self, key, value, /)
 |      Set self[key] to value.
 |  
 |  asarray(...)
 |  
 |  ascapsule(...)
 |  
 |  asstring(...)
 |  
 |  getsize(...)
 |  
 |  getwriteable(...)
 |  
 |  setsize(...)
 |  
 |  setwriteable(...)
 |  
 |  ----------------------------------------------------------------------
 |  Static methods defined here:
 |  
 |  __new__(*args, **kwargs) from builtins.type
 |      Create and return a new object.  See help(type) for accurate signature.
>>> inspect.signature(sip.voidptr.__init__)
<Signature (self, /, *args, **kwargs)>
>>> sip.voidptr.__init__()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: descriptor '__init__' of 'object' object needs an argument

If we end up merging something here without full satisfaction, maybe it would make sense to have a ticket rather than a changelog entry to track the need for future work?

@BryceBeagle
Copy link
Collaborator

If we end up merging something here without full satisfaction, maybe it would make sense to have a ticket rather than a changelog entry to track the need for future work?

If we continue with the change as-is, we should probably include it in the changelog. Opening an issue is a good idea regardless of if we continue with the change here in this PR

@altendky
Copy link
Collaborator Author

altendky commented Oct 4, 2020

  • #104 sip.voidptr handles integer values and sequences

Does it need ' and takes `self`' added on the end?

I thought you suggested more changelog commentary covering uncertainty about what this bit of stub should be. That bit I thought belonged in an issue not a changelog entry. I agree the change made here ought to have an entry for the change itself.

@BryceBeagle
Copy link
Collaborator

Does it need ' and takes self' added on the end?

Yeah that's what I'm suggesting

@altendky altendky merged commit 121dc88 into python-qt-tools:master Oct 4, 2020
@altendky altendky deleted the voidptr branch October 4, 2020 19:18
bluebird75 pushed a commit to bluebird75/PyQt5-stubs that referenced this pull request Aug 24, 2021
sip.voidptr handles integer values and sequences
bluebird75 added a commit to bluebird75/PyQt5-stubs that referenced this pull request Apr 26, 2022
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.

2 participants