<?xml version='1.0' encoding='utf-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2023-09-13T17:29:14.365315Z</updated><id>tag:lukeplant.me.uk,2018:/isso/thread/blog/posts/pythons-disappointing-superpowers/</id><title>Comments for lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/</title><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1369</id><title>Comment #1369</title><updated>2023-09-13T17:29:14.365315Z</updated><author><name>Donald "Paddy" McCarthy</name></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1369" /><content type="html">&lt;p&gt;I had a real use case of needing to extract expressions for gate-level standard cells used in Digital design, from a PDF, and convert the expression to Python then generate the truth table.
The truth table generation I turned into this RosettaCode task and my Python solution uses compile and eval to very succinctly turn any Python boolean expression into a truth table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://rosettacode.org/wiki/Truth_table#Python" rel="nofollow noopener"&gt;https://rosettacode.org/wiki/Truth_table#Python&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1323</id><title>Comment #1323</title><updated>2023-02-04T17:06:52.931602Z</updated><author><name /></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1323" /><content type="html">&lt;p&gt;Marcos: &amp;quot;and if not, we&amp;#39;ll probably fork the language&amp;quot;&lt;/p&gt;

&lt;p&gt;But forking a language is virtually impossible.  A language is, by definition, a tool for communication.  Once forked, it&amp;#39;s a different language.  You&amp;#39;re probably not going to share (or call) code across this boundary -- especially if you&amp;#39;re forking it to (re-)allow dynamic metaprogramming, as above.&lt;/p&gt;

&lt;p&gt;You can fork the implementation, but even this is almost impossible.  How many such forks have there ever been?  Off the top of my head, I can only think of a couple that might fit this description -- started by large companies, who then got out of that business as soon as possible.  It seems as though, if you&amp;#39;ve got the resources to maintain a fork, you&amp;#39;ve got the resources to design your own language from scratch which suits your needs even better.&lt;/p&gt;</content></entry><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1322</id><title>Comment #1322</title><updated>2023-02-03T09:23:55.572696Z</updated><author><name>hsfzxjy</name></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1322" /><content type="html">&lt;p&gt;I&amp;#39;ve worked on an experimental project lambdex [1] to make Python &amp;quot;support&amp;quot; multi-line lambda expressions, which involves a great number of dynamic techniques I have ever crafted in the realm of Python. It more or less resembles Pony-ORM that compiles the &amp;quot;DSL&amp;quot; into Python code at runtime, works as an interesting attempt to extend Python with itself.&lt;/p&gt;

&lt;p&gt;[1] &lt;a href="https://github.com/hsfzxjy/lambdex" rel="nofollow noopener"&gt;https://github.com/hsfzxjy/lambdex&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1320</id><title>Comment #1320</title><updated>2023-02-02T17:21:15.901827Z</updated><author><name>Bruce</name></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1320" /><content type="html">&lt;p&gt;You have to see &lt;a href="http://Dynaconf.com" rel="nofollow noopener"&gt;Dynaconf.com&lt;/a&gt; and how it does a lot of those tricks to load as a django extension or dynamically read nested data.&lt;/p&gt;</content></entry><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1319</id><title>Comment #1319</title><updated>2023-02-02T14:49:58.542086Z</updated><author><name>Duncan Booth</name></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1319" /><content type="html">&lt;p&gt;&amp;quot;consider the fact that Python has had support for keyword arguments since as long as I can remember, and for keyword-only arguments since Python 3.0. But typing.Callable has zero support for them, meaning they can’t be typed in a higher-order context. &amp;quot;
You can type keyword arguments but you have to do it using &lt;code&gt;typing.Protocol&lt;/code&gt; rather than &lt;code&gt;typing.Callable&lt;/code&gt;. With &lt;code&gt;Protocol&lt;/code&gt; you can even handle overloaded functions where the allowable keyword arguments come in different groups.&lt;/p&gt;</content></entry><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1318</id><title>Comment #1318</title><updated>2023-02-02T14:02:45.924136Z</updated><author><name>Marcos Dione</name></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1318" /><content type="html">&lt;p&gt;Hey Kevin. Awesome article, I can&amp;#39;t believe that I somehow forgot all these things were possible.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’m worried that a de-facto move away from dynamic stuff in the Python ecosystem, possibly motivated by those who use Python only because they have to, and just want to make it more like the C# or Java they are comfortable with, could leave us with the very worst of all worlds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don&amp;#39;t quite agree. Static typing is a tool, and since it&amp;#39;s optional in Python, you can easily live without. It&amp;#39;s so optional, that &amp;#39;the&amp;#39; type checker is not even part of the Python release. You and me and everyone else interested can continue to do these magic tricks/ugly hacks forever (and if not, we&amp;#39;ll probably fork the language :-P) &lt;/p&gt;

&lt;p&gt;Meanwhile, most &amp;#39;normal&amp;#39; programming can benefit a lot from static typing. I started sparsely using it in my non-&amp;#39;dynamic&amp;#39; programs and it has definitely helped me find some bugs. I think it&amp;#39;s a good companion of a good seasoning of testing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;you may end up with a lot of tedious and noisy code to pass these dependencies through layers of code, or complex automatic dependency injection frameworks to avoid that&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To be honest, being exposed to &lt;code&gt;golang&lt;/code&gt; meant that I got to experience dependency injection first hand and yes, it can be a pain, but there is a simple solution where you build a constructor that accepts the DI for testing, and then you add a second one that just calls the first one with the values your code is going to use always, and then you use that second constructor everywhere in your code. Yes, you never get 100% coverage, but I&amp;#39;m pretty sure you already know that&amp;#39;s not something you really want to do.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why don’t we talk about these much?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are my 2¢: &lt;a href="https://www.grulic.org.ar/%7Emdione/glob/posts/customizing-the-python-language/" rel="nofollow noopener"&gt;https://www.grulic.org.ar/~mdione/glob/posts/customizing-the-python-language/&lt;/a&gt;&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;On a  final note, I find rather confusing the style for link underlines, specially if the text is so long that it wraps and you end up with half of it of a color, half of it grey.&lt;/p&gt;</content></entry><entry><id>tag:lukeplant.me.uk,2018:/isso/159/1315</id><title>Comment #1315</title><updated>2023-02-01T16:45:08.429111Z</updated><author><name>Kevin Henry</name></author><link href="https://lukeplant.me.uk/blog/posts/pythons-disappointing-superpowers/#isso-1315" /><content type="html">&lt;p&gt;What an amazing post, thank you! You must be right that people don&amp;#39;t talk about 
this much because I can&amp;#39;t recall ever seeing so many meta-programming 
examples in one article. It&amp;#39;s an inspiring reminder of what&amp;#39;s possible 
in Python.&lt;/p&gt;</content></entry></feed>