[Pyobjc-dev] DeprecationWarning: Using struct wrapper as sequence
Brought to you by:
ronaldoussoren
|
From: Just v. R. <jus...@gm...> - 2017-12-17 08:50:32
|
Hello,
I’m using to using NSSize, NSRange, NSRect etc. as sequences quite a lot, as that’s a nice Pythonic way to look at those types.
For example:
>>> url = AppKit.NSURL.URLWithString_("http://f.cl.ly/items/1T3x1y372J371p0v1F2Z/drawBot.jpg")
>>> im = AppKit.NSImage.alloc().initByReferencingURL_(url)
>>> w, h = im.size()
But now I noticed that there are warnings being ussued for that usage:
__main__:1: DeprecationWarning: Using struct wrapper as sequence
My questions are:
- this is so useful, and makes for nice looking code; must it really be deprecated?
- if yes, when will that actually happen?
- I use the reverse a lot, too; will that also be deprecated? For example:
obj.somethingExpectingARect_(((x, y), (w, h)))
Thanks,
Just
|