[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
   ...
> Why wouldn't "the one obvious way" be:
> 
>  def inAnotB(A, B):
>      inA  = set(os.listdir(A))
>      inBs = set(os.listdir(B))
>      return inA.difference(inBs)

If you want a set as the result, that's one possibility (although
possibly a bit wasteful as you're building one more set than necessary);
I read the original request as implying a sorted list result is wanted,
just like os.listdir returns (possibly sorted in case-independent order
depending on the underlying filesystem).  There's no real added value in
destroying inA's ordering by making it a set, when the list
comprehension just "naturally keeps" its ordering.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to