Home
2 comments
PaulHoule9 months ago
You can put arbitrary metadata on functions, classes and other things that are basically objects in in Python. If you write<p><pre><code> def somefunction(x):
... body ...
</code></pre>
you can later write<p><pre><code> somefunction.specialmetadata = "a value"
</code></pre>
so what you can do is fairly unlimited. You can't write, however<p><pre><code> x = 4
x.metavalue = 3
</code></pre>
as the int isn't a general object. Even if you did the metadata would apply to the value (the '4') and not the variable (the 'x')
thesuperbigfrog9 months ago
Clojure supports metadata:<p><a href="https://clojure.org/reference/metadata" rel="nofollow">https://clojure.org/reference/metadata</a>