<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">There's something I found a bit confusing in the runtime semantic of defaults in your strawman proposal:</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Aug 2, 2016 at 11:09 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Agreed, we need to invent a workable proposal for this. Here's a strawman:<br>
<br>
- The default is an instance variable (backed by a class variable as<br>
default if there's an initial value)<br>
- To define a class variable, prefix the type with 'class`<br>
<br>
Example:<br>
<br>
class C:<br>
    a: int  # instance var<br>
    b: List[int] = None  # instance var<br>
    c: class List[int] = []  # class var<br>
<br></blockquote><div><br></div><div>From that description I understand that after C is defined, C.__dict__ will contain the {'c': []} mapping... where us the {'b': None} mapping stored? what's the runtime semantics that get it to every created instance? </div><div><br></div><div>Or you are proposing that in runtime these are equivalent to "b, c = None, []" ? If that's the case, I find it misleading to call them "instance variables" vs "class variables", given that those concepts are supposed to have different runtime semantics, not just for the typechecker.</div><div><br></div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Daniel F. Moisset - <span style="font-size:small">UK Country Manager</span><div><a href="http://www.machinalis.com" target="_blank">www.machinalis.com</a></div><div>Skype: @dmoisset</div></div></div></div></div>
</div></div>