This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients barry, ethan.furman, gvanrossum, methane, rhettinger, serhiy.storchaka, vstinner
Date 2017-10-04.23:12:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507158750.55.0.213398074469.issue31671@psf.upfronthosting.co.za>
In-reply-to
Content
> IntFlag.__and__ does not create a new instance every time -- all new instances are cached in the IntFlag machinery (so RegexFlag(7) is only created once).

I'm sorry, I misunderstood.
But while new instance is not created each time, 4 Python method calls
(e,g.  IntFlag.__and__() -> IntFlag.__new__() -> IntFlag._missing_() -> IntFlag._create_pseudo_member_()) are much slower than int & int.

> If all the RegexFlag combinations are created before the regex compile benchmark do we still see a speed-up?

I believe that's what Victor benchmarked.
History
Date User Action Args
2017-10-04 23:12:30methanesetrecipients: + methane, gvanrossum, barry, rhettinger, vstinner, ethan.furman, serhiy.storchaka
2017-10-04 23:12:30methanesetmessageid: <1507158750.55.0.213398074469.issue31671@psf.upfronthosting.co.za>
2017-10-04 23:12:30methanelinkissue31671 messages
2017-10-04 23:12:30methanecreate