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

NSMutableArray.pop(n) raises error (in some situations...) #334

Closed
ronaldoussoren opened this issue Nov 17, 2020 · 2 comments
Closed

NSMutableArray.pop(n) raises error (in some situations...) #334

ronaldoussoren opened this issue Nov 17, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ronaldoussoren
Copy link
Owner

The test suite for pyobjc-core fails due to anNSMutableArray.pop(1) raises an error. Running that particular test on its own does not raise an error.

It looks like a category on NSMutableArray adds a pop method on the ObjC side, hiding the convenience method added by PyObjC.

@schriftgestalt
Copy link

I just run into the same problem when running inside my app (objectiveC app loading the python framework)

@ronaldoussoren
Copy link
Owner Author

The problem here is that some category introduces an undocumented pop method in a subclasss of NSMutableArray, which is then bridged to Python as an argumentless pop() method. That method replaces the list-compatible implementation pop that I've added to the NSMutableArray proxy.

I currently don't have an sane way to deal with this, other than trying to manually enumerate all subclasses of NSMutableArray and adding my implementation of pop to the proxy of those classses. That would be pretty fragile and is not something I want to do.

I hope to be able to fix this cleanly once I implement #306. That will move a lot of the interesting logic of build class proxies from Objective-C to Python, which should make it easier to add tweaks to that code.

ronaldoussoren added a commit that referenced this issue Apr 6, 2021
- Add MAC_OS_X_VERSION_11_X for recent versions of X
- Mark tests of ``NSMutableArray.pop`` as expectedFailure (see #334)
- Disable a number of pickle tests inherited from the stdlib
  (some of those need further investigation, but in general these test
   details of the stdlib pickle library that aren't relevant for PyObjC)
@ronaldoussoren ronaldoussoren added the bug Something isn't working label May 5, 2021
@ronaldoussoren ronaldoussoren added this to the Internals Cleanup milestone Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants