From fc4cfcb0d6da0f09e751779fc54a0c8b95dcc78e Mon Sep 17 00:00:00 2001 From: twetzel59 Date: Wed, 27 Dec 2017 21:05:24 -0500 Subject: [PATCH] Say when to use set vs HashSet --- Nim-for-Python-Programmers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nim-for-Python-Programmers.md b/Nim-for-Python-Programmers.md index d70bcd4..ca1163b 100644 --- a/Nim-for-Python-Programmers.md +++ b/Nim-for-Python-Programmers.md @@ -188,7 +188,7 @@ echo lc[ y*2 | ( y <- x ), int ] Python sets are not like [Nim set type](http://nim-lang.org/docs/manual.html#types-set-type). If the values that will go in the set are known beforehand and finite, you can create an Enum for them. Otherwise you can emulate a Python set using a [HashSet](http://nim-lang.org/docs/sets.html). -The Nim set type is faster and memory-efficient. +The Nim set type is faster and memory-efficient. In fact, set is implemented with a bit vector, whereas HashSet is implemented as a dictionary. For simple flag types and small mathematical sets, use set. ### Dictionaries