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/2004-January/041851.html below:

[Python-Dev] collections module

[Python-Dev] collections module [Python-Dev] collections moduleSkip Montanaro skip at pobox.com
Fri Jan 9 11:17:28 EST 2004
    >> I'm neither a Smalltalk, C++ or Objective C programmer.  How is a bag
    >> different from a set?

    Alex> In a bag, or multiset, a certain item can be in the collection a
    Alex> given _number_ of times, rather than just "either being there or
    Alex> not" as in a set.

Thx.

    >> Oddly enough, although we used collections heavily, I never really
    >> missed that functionality in Python.  I implemented it once or twice,
    >> but never used it much.  Different style of programming I guess.

    Alex> for item in collection: item.turn()

or

    Alex> collection.each(lambda x: x.turn())

In LYMB (using Python syntax) it would have been something more like

    all_actors.look_at(active_camera.position())

Hard to get any clearer than that. ;-)

It's pretty easily done with __getattr__.

Skip

More information about the Python-Dev mailing list

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