A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-January/012146.html below:

[Python-Dev] I think my set module is ready for prime time; comments?

[Python-Dev] I think my set module is ready for prime time; comments? [Python-Dev] I think my set module is ready for prime time; comments?Paul Prescod paulp@ActiveState.com
Wed, 24 Jan 2001 08:56:26 -0800
Guido van Rossum wrote:
> 
>...
> 
> > Cool idea, but even cooler (would catch more idioms, that is) is
> > "the first time someone stores something not 'is'  something in the
>
> Sorry, but I don't understand what you mean by the ^^^ marked phrase.
> Can you please elaborate?

I wasn't clear about that either. The idea is:

def add(new_value):
    if not values_array:
        if self.magic_value is NULL:
            self.magic_value = new_value
        elif new_value is not self.magic_value:
            self.values_array=[self.magic_value, new_value, ... ]
        else:
            # new_value is self.magic_value: do nothing

I am neutral on this proposal myself. I think that even if we optimize
any code where you pass the same thing over and over again, we should
document a convention for consistency. So I'm not sure there is much
advantage.

 Paul Prescod



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4