On Fri, Sep 3, 2021 at 3:24 PM Steven D'Aprano wrote:
>
> On Thu, Sep 02, 2021 at 04:54:45PM +0900, Stephen J. Turnbull wrote:
> > Steven D'Aprano writes:
> > > On Thu, Sep 02, 2021 at 04:04:40PM +0900, Stephen J. Turnbull wrote:
> > >
> > > > You may not need to teach them about singletons, th
On Thu, Sep 02, 2021 at 04:54:45PM +0900, Stephen J. Turnbull wrote:
> Steven D'Aprano writes:
> > On Thu, Sep 02, 2021 at 04:04:40PM +0900, Stephen J. Turnbull wrote:
> >
> > > You may not need to teach them about singletons, though.
> >
> > It's hard to teach why `is` works with None,
>
>
Kevin Mills suggested:
> > > d = {1: {2: {3: 4}}}
> > > keys= 1,2,3
> > > print(d[*keys])
> > > d[*keys] = None
> > > print(d)
> > >
> > > Hopefully it's clear from that example what I'm suggesting.
MRAB replied:
> > Would that be equivalent to d[keys[0], keys[1], keys[2]]?
> >
> > If so, it wo
On Fri, Sep 3, 2021 at 12:45 AM Peter Otten <__pete...@web.de> wrote:
>
> On 02/09/2021 11:41, Chris Angelico wrote:
> > On Thu, Sep 2, 2021 at 7:36 PM Peter Otten <__pete...@web.de> wrote:
> >>
> >> On 02/09/2021 04:32, Steven D'Aprano wrote:
> >>> On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter O
On 02/09/2021 11:41, Chris Angelico wrote:
On Thu, Sep 2, 2021 at 7:36 PM Peter Otten <__pete...@web.de> wrote:
On 02/09/2021 04:32, Steven D'Aprano wrote:
On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter Otten wrote:
Instead of removing it you might add a filter to get a similar effect:
[.
Dear 笹原康央,
This sounds interesting. The assignment could be done e.g., like
this.
```python
def assign(variables):
return f'''
for _variable, _value in (lambda {variables}: locals())(
*_values, **_assignments
).items():
exec(f'{{_variable}} = _value')
'''
def name_update(_nam
On Thu, Sep 2, 2021 at 7:36 PM Peter Otten <__pete...@web.de> wrote:
>
> On 02/09/2021 04:32, Steven D'Aprano wrote:
> > On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter Otten wrote:
> >
> >> Instead of removing it you might add a filter to get a similar effect:
> >
> > [...]
> >
> > warnings.fi
On 02/09/2021 04:32, Steven D'Aprano wrote:
On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter Otten wrote:
Instead of removing it you might add a filter to get a similar effect:
[...]
warnings.filterwarnings("always", "woof!")
Unfortunately that's too aggressive. In my use-case, `bark` will
On Thu, Sep 2, 2021 at 5:56 PM Stephen J. Turnbull
wrote:
>
> Steven D'Aprano writes:
> > On Thu, Sep 02, 2021 at 04:04:40PM +0900, Stephen J. Turnbull wrote:
> >
> > > You may not need to teach them about singletons, though.
> >
> > It's hard to teach why `is` works with None,
>
> For defini
Steven D'Aprano writes:
> On Thu, Sep 02, 2021 at 04:04:40PM +0900, Stephen J. Turnbull wrote:
>
> > You may not need to teach them about singletons, though.
>
> It's hard to teach why `is` works with None,
For definitions of "works" that comes down to "agrees with Nick that
'is' is just a
On Thu, Sep 02, 2021 at 04:04:40PM +0900, Stephen J. Turnbull wrote:
> You may not need to teach them about singletons, though.
It's hard to teach why `is` works with None, but not with 1.234 or [],
without talking about the object model and singletons.
To say nothing of why it works with 0 and
Michael Lee writes:
> None is primarily useful for representing the absence of some
> value, and I'm not sure if that's something beginners actually need
> to write interesting and useful code.
In Python, we generally think of writing code as a subordinate
skill. :-) In reading code, beginner
12 matches
Mail list logo