Just because you can ==================== ----- Just because you can ==================== .footer: Slides/Twitter **@ionelmc** .. class:: center large You have to try it! .footer: `EuroPython 2015 `_ — generated with `Darkslide `_ ----- Would this be possible? ======================= .. sourcecode:: python class Pizza(Fields.name.size): pass .. sourcecode:: pycon >>> Pizza("Pepperoni", "large") Pizza(name='Pepperoni', size='large') ----- How about this? =============== .. sourcecode:: python class Pizza(Fields.name.ingredients.crust.size): pass .. sourcecode:: pycon >>> Pizza("Funghi", ["mushrooms", "mozarella"], "thin", "large") Pizza(name='Funghi', ingredients=['mushrooms', 'mozarella'], crust='thin', size='large') ----- But ... ======= .. class:: center Before we consider this for inclusion in the standard library ... ----- What would normal people say ============================ .. class:: center „Don't speak around saying that I like it.” | ”Are Python programmers *that* lazy?” *--Some Java developer* | „Is it some Ruby thing?” | „WHAT?!?!” | „I don't think it should work ...” ----- And last ... ============ Of course it has support for defaults! -------------------------------------- .. sourcecode:: python class Pizza(Fields.name.crust["thing"].size["large"]): pass .. sourcecode:: pycon >>> Pizza("Funghi", crust="thick") Pizza(name='Funghi', crust='thick', size='large') ----- Shameful plug ============= .. class:: center large https://github.com/ionelmc/python-fields | Sorry!