A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171102/6d34b6a9/attachment.html below:

<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 2, 2017 at 7:39 PM, Jukka Lehtosalo <span dir="ltr"><<a href="mailto:jlehtosalo@gmail.com" target="_blank">jlehtosalo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>As type checking has become the main use case for annotations, using annotations without a type checker is fast becoming a marginal use case. Type checkers can easily and reliably validate that names in annotations <span class="gmail-m_-6752527550485021606gmail-"></span><span class="gmail-m_-6752527550485021606gmail-"></span>aren't misspelled.<br></div></div></div></div></blockquote><div><br></div><div>Another common use case is dependency injection / IoC:</div><div><br></div><div>Examples include:</div><div><br></div><div>- Injector (<a href="https://github.com/alecthomas/injector">https://github.com/alecthomas/injector</a>):</div><div><br></div><div><div>>>> class Outer:</div><div>...  Â  Â @inject</div><div>...  Â  Â def __init__(self, inner: Inner):</div><div>...  Â  Â  Â  Â self.inner = inner</div><div><br></div></div><div><br></div><div>- Flsk-Injector (ok it's the same underlying injector):</div><div><br></div><div><div># Route with injection</div><div>@app.route("/foo")</div><div>def foo(db: sqlite3.Connection):</div><div>  Â  users = db.execute('SELECT * FROM users').all()</div><div>  Â  return render("foo.html")</div></div><div><br></div><div>- Apistar components (<a href="https://github.com/encode/apistar#components">https://github.com/encode/apistar#components</a> ):</div><div><br></div><div><div>def say_hello(user: User):</div><div>  Â  return {'hello': user.username}</div></div><div><br></div><div>=> In each of the examples, the type annotation are used at runtime by the IoC container to inject an object of the appropriate type, based on some specifications.</div><div><br></div><div>They may or may not be used by a typechecker too, but that's secondary.</div><div><br></div><div>  S.</div><div><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Stefane Fermigier - <a href="http://fermigier.com/" target="_blank">http://fermigier.com/</a> - <a href="http://twitter.com/sfermigier" target="_blank">http://twitter.com/sfermigier</a> - <a href="http://linkedin.com/in/sfermigier" target="_blank">http://linkedin.com/in/sfermigier</a><br>Founder & CEO, Abilian - Enterprise Social Software - <a href="http://www.abilian.com/" target="_blank">http://www.abilian.com/</a><br>Chairman, Free&OSS Group / Systematic Cluster - <a href="http://www.gt-logiciel-libre.org/" target="_blank">http://www.gt-logiciel-libre.org/</a><br>Co-Chairman, National Council for Free & Open Source Software (CNLL) - <a href="http://cnll.fr/" target="_blank">http://cnll.fr/</a><div>Founder & Organiser, PyData Paris - <a href="http://pydata.fr/" target="_blank">http://pydata.fr/</a><br></div><div>---</div><div><div>“You never change things by ï¬ghting the existing reality. To change something, build a new model that makes the existing model obsolete.” <span style="font-size:12.8px">— R. Buckminster Fuller</span></div></div><div><br><br></div></div></div></div></div></div></div></div>
</div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4