Re: [Python-ideas] Is there any idea about dictionary destructing?

2018-04-07 Thread Nikolas Vanderhoof
And this should print: 'some data' 1 2 3 On Sat, Apr 7, 2018 at 4:16 PM, Nikolas Vanderhoof < nikolasrvanderh...@gmail.com> wrote: > This would be a very handy feature, but Coconut (which is just python with > some extra functional-style features) also has support for this kind

Re: [Python-ideas] Is there any idea about dictionary destructing?

2018-04-07 Thread Nikolas Vanderhoof
Although that particular example once compiled to python will generate many many lines of code: ​ On Sat, Apr 7, 2018 at 4:17 PM, Nikolas Vanderhoof < nikolasrvanderh...@gmail.com> wrote: > And this should print: > > 'some data' > 1 > 2 > 3 > > On Sat, Apr 7, 2018

Re: [Python-ideas] Is there any idea about dictionary destructing?

2018-04-07 Thread Nikolas Vanderhoof
This would be a very handy feature, but Coconut (which is just python with some extra functional-style features) also has support for this kind of pattern-matching: http://coconut-lang.org ​Since Coconut will compile to Python (2 or 3) you can just write in Coconut and use the resulting code in

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Nikolas Vanderhoof
Thank you for your explanation! ᐧ On Thu, Jan 18, 2018 at 11:00 PM, Guido van Rossum <gu...@python.org> wrote: > On Thu, Jan 18, 2018 at 7:51 PM, Nikolas Vanderhoof < > nikolasrvanderh...@gmail.com> wrote: > >> I sometimes wish that Python included a richer set of asse

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Nikolas Vanderhoof
> > I sometimes wish that Python included a richer set of assertions rather > than just a single `assert` keyword. Something like Eiffel's concept of > pre-conditions, post-conditions and invariants, where each can be > enabled or disabled independently. Has something like this been proposed for

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-17 Thread Nikolas Vanderhoof
I think having a means for such validations separate from assertions would be helpful. However, I agree with Steven that 'validate' would be a bad keyword choice. Besides breaking compatibility with programs that use 'validate', it would break wsgiref.validate