On Mon, Feb 22, 2021 at 6:27 PM Paul Sokolovsky <pmis...@gmail.com> wrote:
>
> Hello,
>
> On Mon, 22 Feb 2021 15:51:37 +1100
> Chris Angelico <ros...@gmail.com> 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. (And lowercase in
> general, with the exception of handful(!) core types).
>
> A typical use is:
>
> ns = SimpleNamespace()
>
> Anyone who doesn't agree always has "import as" in their disposal (as a
> more structured form of "whatever_i_want = official_descriptive_name").
>
>
> > * mutableobject
> > * attrobject
> >
> > I've written them all in lowercase, but equally viable would be to
> > spell it MutableObject etc. Half of the collections module is each way
> > at the moment.
>
> There's only one lower-case type name in "collections" - deque. Umm,
> with some squinting, you can see that as "semi-core" type, like "list".

Two - deque and defaultdict.

> namedtuple() is not a type, it's a function. Yes, semantically it's a
> type constructor, and somewhere like in Haskell it would follow naming
> conventions for types, but in Python, it happens to be just a function,
> and happened to follow naming conventions for functions.

Just as int used to be a function, not a type. The distinction really
isn't all that fundamental (and people periodically ask about
issubclass(x, namedtuple), which would depend on it becoming a type
after all).

> So, hopefully window for the lower-case types is as closed as anytime
> (last case was indeed adding "odict" as a builtin alias for
> collection.OrderedDict instead of falling for 3.6 mapping algorithmic
> fiasco), and all newly added types will follow the established
> naming conventions.
>

I'm fine with it ending up with an uppercase name, as mentioned in the
summary a couple of posts back. Doesn't really bother me either way,
and I doubt it'll bother most of the people who use it. But a short
name, and in collections rather than types, will be a definite
improvement.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MV3V7QL4IK7IPILXI2OJC2M3MYREFHWO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to