BUG: GH42866 DatetimeIndex de-serializing fails in PYTHONOPTIMIZE mode
- [x] closes #42866
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

Thanks @GorAlexander 

@jbrockmendel does pandas have any way of testing code run in `-O` mode? > does pandas have any way of testing code run in -O mode?

take a look at test_oo_optimizable Thanks - @GorAlexander do you want to have a look there and add a test? Hello @GorAlexander! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2021-08-04 21:56:34 UTC looks fine, can you add a whatsnew note. 1.4 bug fix, Datetimelike section. ping on green. @github-actions pre-commit Hi @jreback , I have fixed code-styles and added whatsnew note.
Is it possible to apply this fix to version 1.3? would be ok for 1.3.x if u can move the note  no we merge to master and then backport

just change the note @jreback , thanks! I've moved the note to v1.3.2, so it must be ready. Hi @jreback , the whatsnew note was corrected, however GH still highlights about 'changes requested'. Is there smth else to do to get the PR approved? thanks @GorAlexander  @meeseeksdev backport 1.3.x Something went wrong ... Please have  a look at my logs.