On 18.02.21 05:43, Chris Angelico wrote:
On Thu, Feb 18, 2021 at 1:59 PM Ben Rudiak-Gould wrote:
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
object would get a dict, and nothing else
On 2021-02-21 20:51, Chris Angelico wrote:
In my mind, the current front-runners are:
* namespace
* ns
* thing
* mutableobject
* mobject
* attrobject
* bunch
Short and PascalCase please, to avoid collisions:
* Stuff
With credit to George Carlin. ;-)
Some of these work as well, Kit is not
On Mon, Feb 22, 2021 at 11:22:09AM +, Rob Cliffe via Python-ideas wrote:
> What's wrong with "namespace"? None of the other names IMO convey the
> intended/suggested use nearly as well.
The problem with "namespace" is that the intended us is not as a
namespace, but as a dict using `.` synt
On 22/02/2021 04:51, Chris Angelico wrote:
On Mon, Feb 22, 2021 at 1:11 PM Brendan Barnwell wrote:
Why not just put SimpleNamespace in the collections module? The one in
types could be aliased to it (or vice versa if we really don't want to
change anything). That seems like it's a
On Mon, Feb 22, 2021 at 06:26:28PM +1100, Chris Angelico wrote:
> Ultimately, SimpleNamespace is useless if it can't be found.
"Can't" be found is an exaggeration.
The std lib is full of little gems, and people learn them and use them.
Generally when people talk about something that "can't be f
On Mon, Feb 22, 2021 at 10:27:55AM +0300, Paul Sokolovsky wrote:
> Such short generic names shouldn't be used for types added so late in
> the language evolution. Those are names for variables. (And lowercase in
> general, with the exception of handful(!) core types).
A handful you say.
int, flo
Hello,
On Mon, 22 Feb 2021 18:26:28 +1100
Chris Angelico wrote:
> On Mon, Feb 22, 2021 at 6:08 PM Paul Sokolovsky
> wrote:
> > One explanation why SimpleNamespace is not in "collections" is
> > because ... it's not a collection. One of the basic traits of any
> > collection is that it "contains
On Mon, Feb 22, 2021 at 6:27 PM Paul Sokolovsky wrote:
>
> Hello,
>
> On Mon, 22 Feb 2021 15:51:37 +1100
> Chris Angelico wrote:
>
> []
>
> > In my mind, the current front-runners are:
> >
> > * namespace
>
> > * ns
> > * thing
> > * mobject
> > * bunch
>
> Such short generic names shouldn't be u
Hello,
On Mon, 22 Feb 2021 15:51:37 +1100
Chris Angelico wrote:
[]
> In my mind, the current front-runners are:
>
> * namespace
> * ns
> * thing
> * mobject
> * bunch
Such short generic names shouldn't be used for types added so late in
the language evolution. Those are names for variables.
On Mon, Feb 22, 2021 at 6:08 PM Paul Sokolovsky wrote:
> One explanation why SimpleNamespace is not in "collections" is because
> ... it's not a collection. One of the basic traits of any collection is
> that it "contains" things, and thus it can be directly iterated over to
> traverse those conte
Hello,
On Sun, 21 Feb 2021 16:51:37 -0800
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
On Mon, Feb 22, 2021 at 1:11 PM 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
On Mon, Feb 22, 2021 at 2:09 AM Brendan Barnwell
wrote:
> Thinking about this more, I think the main obstacle to use of
> SimpleNamespace isn't the name, it's its the location. No one is going
> to look in the types module for something like this. Why not just put
> SimpleNamespace in t
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 "object"
Are we just trying to list every imaginable word that is even vaguely
related to the concept of "something that holds something"? If we have
plate, tray, board then surely we should include saucer, cup, bowl, pot,
frying_pan, cheeseboard, box, suitcase, luggage, handbag, ...
Trying to exhaustiv
On 2021-02-20 at 13:44:21 -0500,
David Mertz wrote:
> Cheeseshop!
But then it would never contain the attribute I ask for, and throw a
different exception every time! ;-)
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an
Cheeseshop!
On Sat, Feb 20, 2021, 1:08 PM Jan Kaliszewski wrote:
> 2021-02-18 Chris Angelico dixit:
>
> [...]
> > 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
2021-02-18 Chris Angelico dixit:
[...]
> 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 "obj
On Sat, Feb 20, 2021, 12:56 PM Jan Kaliszewski wrote:
> 2021-02-17 Ricky Teachey dixit:
>
> > * patsy
>
> I love this one! :-)
>
> Cheers.
> *j
>
> PS. But it should be callable and, when called, it should raise
> RuntimeError("It's only a model!")
>
Have to admit I was proud of this idea. Hah
2021-02-17 Ricky Teachey dixit:
> * patsy
I love this one! :-)
Cheers.
*j
PS. But it should be callable and, when called, it should raise
RuntimeError("It's only a model!")
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe se
> If SimpleNamespace were to become a builtin, what should its name be?
Just to have the obvious out of the way:
* obj() - fits with most other builtins in that they are abbreviations
and 3-4 letters
* data() - same, might be confused with dataclass
* container()
* values()
Most of these are lik
On Thu, Feb 18, 2021 at 9:57 PM Steven D'Aprano wrote:
>
> On Thu, Feb 18, 2021 at 06:21:19AM +1100, Chris Angelico 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 t
On 18.02.2021 12:00, Steven D'Aprano wrote:
> On Wed, Feb 17, 2021 at 11:28:05AM -0800, Brendan Barnwell wrote:
>
>> When I see people suggest
>> SimpleNamespace, it's usually just to use it as a dict which is accessed
>> with attribute syntax instead of item syntax.
>
> If its a dict, it must
On Wed, Feb 17, 2021 at 11:28:05AM -0800, Brendan Barnwell wrote:
> When I see people suggest
> SimpleNamespace, it's usually just to use it as a dict which is accessed
> with attribute syntax instead of item syntax.
If its a dict, it must have dict methods. That leads to conflict: data
fields
On Thu, Feb 18, 2021 at 06:21:19AM +1100, Chris Angelico 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?
The traditional name i
Hello,
On Thu, 18 Feb 2021 21:27:18 +1100
Steven D'Aprano wrote:
[]
> Or we could just use a one-liner:
>
> >>> from types import SimpleNamespace
>
> and get all of that for free. And if it were a builtin, it would be a
> zero-liner.
Right. If the whole CPython stdlib were builtin, it
On Thu, Feb 18, 2021 at 11:50:17AM +1300, Greg Ewing wrote:
> It's dead simple to define
> your own blank-object class, and you get to give it a name that
> reflects what you're really doing with it. I don't understand
> why there's such a fascination with things like SimpleNamespace.
Right, it t
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 Sim
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 need
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 typ
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 obje
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 ba
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 d
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: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 get
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 "object"
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 built-in.
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
> builtin,
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 restriction
>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 obj
44 matches
Mail list logo