Message272021
I'm back on the issue. I'm currently stuck on the design. We need to store the regexes somewhere, and that's what causes problem : I can't really find a good place to store them. We basically have two possible designs :
* single dispatch kind, class-type dictionary lookup for regexes, stored in _strpime.py. It's minimally invasive, allow a very simple C implementation, and allows us to avoid to add a 're' import in datetime.py. Problem : it breaks when the given class is not of type date, time or datetime. And it currently breaks the tests because tests are doing this, testing using subclasses. We could rely on "isinstance" but do we want this ?
* regex stored as classes attributes. More robust, more invasive, 're' import in datetime.py, allows subclassing, passes test. C implementation not done yet. Since it requires a better understanding of the C API, I will do it only we are sure that's the way to go.
I post the two versions of the implementation as patches here. These adress all the concerns expressed before (Martin). If we can't decide, I will post a mail on the mailing list Martin suggested, python-ideas. By the way, are you sure it's the right one to ask ? Wouldn't be python-dev more appropriated ? |
|
Date |
User |
Action |
Args |
2016-08-05 09:37:08 | deronnax | set | recipients:
+ deronnax, barry, jcea, roysmith, belopolsky, nagle, vstinner, jwilk, mcepl, eric.araujo, Arfrever, r.david.murray, davydov, cvrebert, karlcow, SilentGhost, perey, flying sheep, mihaic, aymeric.augustin, Roman.Evstifeev, berker.peksag, martin.panter, piotr.dobrogost, kirpit, Anders.Hovmöller, jstasiak, Eric.Hanchrow, pbryan |
2016-08-05 09:37:08 | deronnax | set | messageid: <1470389828.32.0.558805657352.issue15873@psf.upfronthosting.co.za> |
2016-08-05 09:37:08 | deronnax | link | issue15873 messages |
2016-08-05 09:37:07 | deronnax | create | |
|