[Python-ideas] PEP 526: why ClassVar instead of ClassAttr?

Guido van Rossum guido at python.org
Wed May 17 01:11:31 EDT 2017


There was another reason too. Many things are "class attributes" e.g.
methods, descriptors. But only specific things are class *variables*. Trust
me, we debated this when the PEP was drafted. ClassVar is better than
ClassAttr.

On Tue, May 16, 2017 at 7:54 PM, Juancarlo Añez <apalala at gmail.com> wrote:

>
> On Tue, May 16, 2017 at 10:10 PM, Guido van Rossum <guido at python.org>
> wrote:
>
>> It's "class variable" because we (at least I) also routinely use
>> "instance variable".
>
>
> It is `getattr()`, `setattr()`, and a very long etc. in Python.
>
> I agree with the OP that a sudden talk about "vars"  is confusing, more so
> when Python doesn't have "vars", but "names"  (etc.).
>
> Cheers!
>
>
> --
> Juancarlo *Añez*
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170516/3351c5e9/attachment.html>


More information about the Python-ideas mailing list