Re: [Pyobjc-dev] DeprecationWarning: Using struct wrapper as sequence
Brought to you by:
ronaldoussoren
|
From: Just v. R. <jus...@gm...> - 2017-12-19 12:23:33
|
That’s great news. Thank you!
Just
> On 19 Dec 2017, at 09:23, Ronald Oussoren <ron...@ma...> wrote:
>
> You’ve got a good point there. I’ll undeprecate in the next release.
>
> I personally don’t like the sequence nature of named tuples and structseq (where this api is modeled on), but your code does look nice.
>
> Ronald
>
> --
> On the road, hence brief.
>
> Op 18 dec. 2017 om 17:18 heeft Just van Rossum <jus...@gm...> het volgende geschreven:
>
>> 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
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Pyobjc-dev mailing list
>> Pyo...@li...
>> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|