I have an application that could benefit from using sets. Currently
I'm using lists but I'd like to avoid linear time when I can get
constant time. The set type is the best option for me but my
application has to also work with Python versions 2.3-2.5. I have seen
people use this trick for backward compatibility (---- is used for
indentation):

cdef object set
try:
----set = __builtins__.set
except AttributeError:
----from sets import Set as set

When using this trick will Cython still use PySet_* in the Python API
where available?

As a side note, how about making an adjustment to Cython that
automatically handles the set type/sets module trick?

-Aaron
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to