How to pass named arguments into python function from hy
<p>I am trying to use a python function with named arguments from hy.</p>

<p>I'm using the NLTK library as well.</p>

<p>In python I would do something like this</p>

<pre><code>from nltk.corpus import brown
brown.words(categories='news')
</code></pre>

<p>to get a list of words in the 'news' category.</p>

<p>I would like to do the same thing in hy. The only way I have figured out to do that is by finding out what order to pass the arguments in, and set all the ones I don't want to <code>None</code></p>

<pre><code>(import [nltk.corpus [brown]])
(.words brown None "news")
</code></pre>

<p>Is there another way to do this in hy that makes my intentions more clear? Imagine trying doing this with a function that has a lot of optional named arguments.</p>

<p>Found the answer in the docs. </p>

<p><a href="http://docs.hylang.org/en/latest/language/api.html#defn" rel="nofollow">defn documentation</a></p>

<p>It would be done like this</p>

<pre><code>(.words brown :categories "news")
</code></pre>

python hy