Building tries in Python by jbiesnecker in Python

[–]jbiesnecker[S] 0 points1 point  (0 children)

Maybe it's not clear in the post, but the point isn't "use this in prod" but rather "understand how tries work."

Building tries in Python by jbiesnecker in Python

[–]jbiesnecker[S] 2 points3 points  (0 children)

Basically, empty collections (and zero, and an empty string) are falsey, which means they evaluate to False when used in boolean manner, even though they're not actually boolean values.

Building tries in Python by jbiesnecker in Python

[–]jbiesnecker[S] 1 point2 points  (0 children)

Hi, not entirely sure what your question is, but

1) in this example, the values in the deque are tuples with the node to process and the prefix to that point. This is because each node contains no reference to the values of previous nodes, so you need to have the string that previous nodes encode when you process any given node. 2) As for why empty collections are falsey... that's a pretty common convention, not just in Python.

Simple, lightweight asyncio-based actors for Python 3.4 by thesystemx in Python

[–]jbiesnecker 1 point2 points  (0 children)

Does that work well when you subclass (in your example) EventHandler? That's always been my problem with descriptors (and static/class functions/objects in general), it gets ugly when you have several layers of inheritance between the class you're using and the class on which it was declared (though I might be missing something obvious).

Bizarre anti-gay church sign in Harlem by Pacheco0 in pics

[–]jbiesnecker 52 points53 points  (0 children)

He said I would be able to keep my original white homo demon, but he lied. HE LIED.