Message291354
namedtuple's attribute access was optimized in recent years. In 3.7 it is 30% faster than in 3.4. So now it is only 3x times slower compared to a plain tuple. On other hand, os.walk() and os.fwalk() was optimized too. In 3.7 they are up to 3.5x times faster than in 3.4 (with hot caches). I didn't make measurements, but I expect that using namedtuples with os.walk() can decrease its performance at least by few percents.
My main concern is that this feature will increase the complexity of the documentation of the os module (very little) and may encourage writing less clear code (but this is just my own preference, others can found new style more clear). |
|
Date |
User |
Action |
Args |
2017-04-09 07:28:29 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, loewis, rhettinger, giampaolo.rodola, ethan.furman, palaviv |
2017-04-09 07:28:29 | serhiy.storchaka | set | messageid: <1491722909.79.0.871317049033.issue26860@psf.upfronthosting.co.za> |
2017-04-09 07:28:29 | serhiy.storchaka | link | issue26860 messages |
2017-04-09 07:28:29 | serhiy.storchaka | create | |
|