Re: [Pyobjc-dev] DeprecationWarning: Using struct wrapper as sequence
Brought to you by:
ronaldoussoren
From: Just v. R. <jus...@gm...> - 2017-12-18 16:18:28
|
In retrospect, I worded my question too mildly... I should have added: This is going to break a LOT of code. (Not just mine.) Just > On 17 Dec 2017, at 09:50, Just van Rossum <jus...@gm...> wrote: > > 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 > |