Closed amtriathlon closed 11 years ago
Hmm incremental adds work:
s = set() s = s.or({1}) s = s.or({1}) s = s.or({2}) s = s.or({1}) print(s) # {2, 1}
Maybe we should be desugaring to that, like dict() does to handle overlapping keys.
On Tue, Mar 26, 2013 at 12:46 PM, Alejandro Martinez < notifications@github.com> wrote:
for example:
print(set([1,2,1]))
gives
{1, 1, 2}
Found this while implementing dir(obj).
— Reply to this email directly or view it on GitHubhttps://github.com/brownplt/lambda-py/issues/54 .
Agree, that's a good idea, it is more general since it works with any iterable and it doesn't require set methods in other datatypes. I will do that.
2013/3/26 Joe Politz notifications@github.com
Hmm incremental adds work:
s = set() s = s.or({1}) s = s.or({1}) s = s.or({2}) s = s.or({1}) print(s) # {2, 1}
Maybe we should be desugaring to that, like dict() does to handle overlapping keys.
On Tue, Mar 26, 2013 at 12:46 PM, Alejandro Martinez < notifications@github.com> wrote:
for example:
print(set([1,2,1]))
gives
{1, 1, 2}
Found this while implementing dir(obj).
— Reply to this email directly or view it on GitHub< https://github.com/brownplt/lambda-py/issues/54> .
— Reply to this email directly or view it on GitHubhttps://github.com/brownplt/lambda-py/issues/54#issuecomment-15471623 .
Alejandro.
for example:
gives
Found this while implementing dir(obj).