Which type should be used when testing static structure appartenance

Chris Angelico rosuav at gmail.com
Wed Nov 18 07:40:09 EST 2015


On Wed, Nov 18, 2015 at 10:37 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> How about Python 3? Python 3 has the advantage of using set literals.

2.7 has set literals too. All the questions of performance should be
secondary to code clarity, though; so I would say the choices are: Set
literal if available, else tuple. Forget the performance.

ChrisA



More information about the Python-list mailing list