Instead of building a list of pre-defined timezones and then sifting through to discard any that are not on disk (i.e. doing 500+ opens, that's what's in the trunk), I build the list by traversing system hierarchy (i.e. doing a couple opens that don't end up in exceptions). Common zones are loaded from zone.tab. I don't really know what you try to achieve, so this may not help you at all.
I'm attaching a patch that defers the loading of all_timezones and all_timezones_set until the first access. It applies on top of the first patch. This cuts off another ~50% of the import time. I haven't tested that very much though, and I'm afraid whether the lazy collections successfully enough mimic their eager counterparts. ** Attachment added: "pytz-lazier-init.patch" http://launchpadlibrarian.net/36397001/pytz-lazier-init.patch -- pytz includes a hard coded list of time zone names https://bugs.launchpad.net/bugs/207604 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
