[Python-ideas] Mark a set of keys of a TypedDict as incompatible

2023-05-17 Thread Sync In
I have a couple of {{{TypedDict}}}s for use in type hinting that are supposed to have some sets of incompatible keys. For example, if I need to specify that a particular {{{dict}}} can have {{{bar}}} or {{{baz}}} but not both of them, I can write two {{{TypedDict}}}s: {{{#!highlight python from

[Python-ideas] Re: Mark a set of keys of a TypedDict as incompatible

2023-05-17 Thread Barry
On 17 May 2023, at 14:16, Sync In wrote:I have a couple of {{{TypedDict}}}s for use in type hinting that are supposed to have some sets of incompatible keys.For example, if I need to specify that a particular {{{dict}}} can have {{{bar}}} or {{{baz}}} but not both of them, I can write two {{{Type

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-17 Thread Daniel Guffey
Thanks for the reference, Lucas. I wasn't familiar with toolz and it looks similar to a package I'm contributing to with a similar purpose of filling holes in the standard library, as such shouldn't some of this stuff be targeted for integration? I'm a bit dubious about the pypi suggestion as pac

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-17 Thread David Mertz, Ph.D.
On Wed, May 17, 2023 at 2:22 PM Daniel Guffey wrote: > I'm a bit dubious about the pypi suggestion as packages are being > regularly poisoned with malware ( e.g. New KEKW malware infects > open-source Python Wheel files via a PyPI distribution | SC Media > (scmagazine.com) >

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-17 Thread Daniel Guffey
Apologies, I didn't mean to imply PyPI was inherently untrustworthy, unusable, or irrelevant. Clearly, it has a place and I use it for packages that I am familiar with and trust. The frame I'm trying to convey is that: 1. Developers are not the only consumers. e.g. If you're in an organization wi

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-17 Thread Chris Angelico
On Thu, 18 May 2023 at 05:14, Daniel Guffey wrote: > > Apologies, I didn't mean to imply PyPI was inherently untrustworthy, > unusable, or irrelevant. Clearly, it has a place and I use it for packages > that I am familiar with and trust. Then I would advise being careful how you word things, si