On Thu, Feb 18, 2021 at 5:25 PM Stephen J. Turnbull
wrote:
>
> Chris Angelico writes:
> > On Thu, Feb 18, 2021 at 1:53 AM Ricky Teachey wrote:
>
> > > I would personally love for SimpleNamespace to get a shorter name
> > > and become a built-in.
> >
> > Okay. Let's start bikeshedding. If
Chris Angelico writes:
> On Thu, Feb 18, 2021 at 1:53 AM Ricky Teachey wrote:
> > I would personally love for SimpleNamespace to get a shorter name
> > and become a built-in.
>
> Okay. Let's start bikeshedding. If SimpleNamespace were to become a
> builtin, what should its name be? It
Abdulla Al Kathiri writes:
> How is this not pythonic?
>
> series.apply(x -> x**2)
> Compared to..
> series.apply(lambda x: x**2)
The main problem is that the second already exists, and the first
doesn't, while the first adds no new power to the language, and isn't
enough more readable
On Thu, Feb 18, 2021 at 1:59 PM Ben Rudiak-Gould wrote:
>
> On Wed, Feb 17, 2021 at 6:12 PM Chris Angelico wrote:
>>
>> But if object() could get arbitrary attributes, then __slots__ wouldn't work.
>
>
> It seems to me that all you'd have to do is add a line or two to the add_dict
> logic in
On Wed, Feb 17, 2021 at 6:12 PM Chris Angelico wrote:
> But if object() could get arbitrary attributes, then __slots__ wouldn't
> work.
>
It seems to me that all you'd have to do is add a line or two to the
add_dict logic in type_new so that instances of object get a dict. Then
instances of
On Thu, Feb 18, 2021 at 1:00 PM Christopher Barker wrote:
>
> > On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze wrote:
>>
>> >> Still think that "object()" should be writable since this seems like an
>> >> arbitrary restriction
>
> ...
>>
>> But I guess there's been discussion around this already.
> On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze wrote:
> >> Still think that "object()" should be writable since this seems like an
> >> arbitrary restriction
...
> But I guess there's been discussion around this already.
>
> ... but changing object would be problematic.
Well, yes, due to
On Wed, Feb 17, 2021, 6:20 PM Daniel Moisset wrote:
> If we're bike shedding, I'd go for "mutableobject". It's not terribly
> short, but it is built on familiar python terminology and does exactly what
> it says in the box: like object() but mutable
>
That is a pretty good suggestion. I'd like
Why is this a discussion?!
Just start your program with:
from types import SimpleNamespace as myfavname
On Wed, Feb 17, 2021 at 11:22 PM Daniel Moisset wrote:
> If we're bike shedding, I'd go for "mutableobject". It's not terribly
> short, but it is built on familiar python terminology and
If we're bike shedding, I'd go for "mutableobject". It's not terribly
short, but it is built on familiar python terminology and does exactly what
it says in the box: like object() but mutable
On Wed, 17 Feb 2021, 23:01 Chris Angelico, wrote:
> On Thu, Feb 18, 2021 at 8:53 AM Brendan Barnwell
>
On Thu, Feb 18, 2021 at 8:53 AM Brendan Barnwell wrote:
>
> On 2021-02-17 11:21, Chris Angelico wrote:
> > Okay. Let's start bikeshedding. If SimpleNamespace were to become a
> > builtin, what should its name be? It needs to be short (obviously),
> > but not TOO short, and it needs to be at least
I agree, I don't think it justifies a builtin, because it is so simple
to just define your own empty class. That said, it does come in handy,
and I do use it for same reasons others have expressed.
On Thu, 2021-02-18 at 11:50 +1300, Greg Ewing wrote:
> On 18/02/21 3:51 am, Ricky Teachey wrote:
>
On 18/02/21 3:38 am, MRAB wrote:
So a "byte" is part of a word (a word contains multiple characters).
In the Burroughs B6900 architecture, programs consisted
of 48-bit words broken up into 8-bit opcodes called "syllables".
--
Greg
___
Python-ideas
On 18/02/21 3:51 am, Ricky Teachey wrote:
I would personally love for SimpleNamespace to get a shorter name and
become a built-in. It is a fantastic object to use in all kinds of
situations
I find myself disagreeing with that. It's dead simple to define
your own blank-object class, and you
Those are not anonymous functions though.
> On 18 Feb 2021, at 1:43 AM, Joao S. O. Bueno wrote:
>
> def f1(x, y):
>return x + y
>
> def f2():
> return 0
>
> def f3(x):
>return x ** 2
>
___
Python-ideas mailing list --
On 2021-02-17 11:21, Chris Angelico wrote:
Okay. Let's start bikeshedding. If SimpleNamespace were to become a
builtin, what should its name be? It needs to be short (obviously),
but not TOO short, and it needs to be at least somewhat descriptive,
and it needs to not cause confusion with
On Wed, 17 Feb 2021 at 18:15, Abdulla Al Kathiri <
alkathiri.abdu...@gmail.com> wrote:
> How is this not pythonic?
>
> series.apply(x -> x**2)
> Compared to..
> series.apply(lambda x: x**2)
>
>
> (x, y) -> x+y, () -> 0, (x) -> x**2 (for single parameter, we can write it
> without parenthesis like
How is this not pythonic?
series.apply(x -> x**2)
Compared to..
series.apply(lambda x: x**2)
(x, y) -> x+y, () -> 0, (x) -> x**2 (for single parameter, we can write it
without parenthesis like the example above) are pythonic enough to my eyes.
Abdulla
> On 17 Feb 2021, at 10:59 PM, Joao
On Wed, Feb 17, 2021 at 2:32 PM <2qdxy4rzwzuui...@potatochowder.com> wrote:
> On 2021-02-18 at 06:21:19 +1100,
> Chris Angelico wrote:
>
> > On Thu, Feb 18, 2021 at 1:53 AM Ricky Teachey wrote:
> > >
> > > I would personally love for SimpleNamespace to get a shorter name and
> become a
On 2021-02-18 at 06:21:19 +1100,
Chris Angelico wrote:
> On Thu, Feb 18, 2021 at 1:53 AM Ricky Teachey wrote:
> >
> > I would personally love for SimpleNamespace to get a shorter name and
> > become a built-in.
>
> Okay. Let's start bikeshedding. If SimpleNamespace were to become a
>
On Thu, Feb 18, 2021 at 1:53 AM Ricky Teachey wrote:
>
> From other thread:
>
> On Wed, Feb 17, 2021 at 5:19 AM Chris Angelico wrote:
>>
>> On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze wrote:
>> > Still think that "object()" should be writable since this seems like an
>> > arbitrary
On Wed, 17 Feb 2021 at 18:30, Ethan Furman wrote:
> On 2/17/21 8:47 AM, Random832 wrote:
> > On Tue, Feb 16, 2021, at 23:24, Stephen J. Turnbull wrote:
>
> >> except a couple of characters. So what currently looks like
> >>
> >> some_list.sort(key=lambda e: e[3].priority)
> >>
> >> would
On Wed, 17 Feb 2021 at 15:31, Ethan Furman wrote:
> On 2/17/21 8:47 AM, Random832 wrote:
> > On Tue, Feb 16, 2021, at 23:24, Stephen J. Turnbull wrote:
>
> >> except a couple of characters. So what currently looks like
> >>
> >> some_list.sort(key=lambda e: e[3].priority)
> >>
> >> would
On 2/17/21 8:47 AM, Random832 wrote:
On Tue, Feb 16, 2021, at 23:24, Stephen J. Turnbull wrote:
except a couple of characters. So what currently looks like
some_list.sort(key=lambda e: e[3].priority)
would then be
some_list.sort(key=(e)->e[3].priority)
Let's not pretend the
On Tue, Feb 16, 2021, at 23:24, Stephen J. Turnbull wrote:
> except a couple of characters. So what currently looks like
>
> some_list.sort(key=lambda e: e[3].priority)
>
> would then be
>
> some_list.sort(key=(e)->e[3].priority)
Let's not pretend the key argument being keyword-only
>From other thread:
On Wed, Feb 17, 2021 at 5:19 AM Chris Angelico wrote:
> On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze wrote:
> > Still think that "object()" should be writable since this seems like an
> > arbitrary restriction (+SimpleNamespace is no builtin and at least I
> > would use
Starting this as a new thread for the interested reader:
On 17.02.21 11:18, Chris Angelico wrote:
On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze wrote:
Still think that "object()" should be writable since this seems like an
arbitrary restriction (+SimpleNamespace is no builtin and at least I
On 2021-02-17 05:57, Steven D'Aprano wrote:
On Wed, Feb 17, 2021 at 11:13:08AM +1300, Greg Ewing wrote:
On 17/02/21 7:10 am, Steven D'Aprano wrote:
>"It's Greek letter, like pi that you may remember from maths
>class. In some technical computer science, the Greek L, lambda, is used
>as the
On Wed, Feb 17, 2021 at 9:11 PM Sven R. Kunze wrote:
> Still think that "object()" should be writable since this seems like an
> arbitrary restriction (+SimpleNamespace is no builtin and at least I
> would use object() for fast PoCs or dirty hackery). But I guess there's
> been discussion around
On 16.02.21 17:26, Steven D'Aprano wrote:
>>> from types import SimpleNamespace
>>> obj = SimpleNamespace()
>>> obj.spam = 1
>>> obj
namespace(spam=1)
Gives you a nice repr so when you are debugging you can actually see
what the object is.
I see that's Python 3
30 matches
Mail list logo