Assorted _libs cleanups
State: closed

Modernize for-loop syntax
Modernize string formatting
Use memoryviews in a few places
Docstrings, change a couple of funcs in tslibs.parsing to cdef

Follow-up cleanup in tslibs.period
Move some unneeded stuff out of tslibs.util to wrap up the self-contained goal.


Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22235?src=pr&el=h1) Report
> Merging [#22235](https://codecov.io/gh/pandas-dev/pandas/pull/22235?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/475e391eaa0c85c4615ad6da5f81dee9b890635b?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/22235/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/22235?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #22235   +/-   ##
=======================================
  Coverage   92.08%   92.08%           
=======================================
  Files         169      169           
  Lines       50704    50704           
=======================================
  Hits        46691    46691           
  Misses       4013     4013
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.49% <ø> (ø)` | :arrow_up: |
| #single | `42.33% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22235?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22235?src=pr&el=footer). Last update [475e391...6ae2c72](https://codecov.io/gh/pandas-dev/pandas/pull/22235?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

lgtm. merge on green.
@pandas-dev/pandas-core do we have any windows users who can help troubleshoot appveyor-only build failures?
@jbrockmendel : I wasn't able to reproduce the AppVeyor failure unfortunately.  That being said, very hard to believe that the removal of the profiler magic comment is the cause of the issue.

But I have to ask: what happens if you put the magic comment back?
>  I wasn't able to reproduce the AppVeyor failure unfortunately. 

Darn, thanks for trying.

> But I have to ask: what happens if you put the magic comment back?

Its worth a try, but I expect the issue isn't with resolution.pyx but in one of its dependencies.
I can reproduce - likely dependent on the 2.7 toolchain - will see what I can figure out
Made a pull on your PR - long story short, it appears you were depending in a couple spots on an implicit include of `stdint.h`, which on MSCV doesn't define `int64_t`, so need a couple workarounds.
thanks @chris-b1 

ok lgtm, merge on green (is the appveyor tests sufficient for this?)
@jreback : The AppVeyor test should be sufficient since it was a build issue.  Also, I would have been much more concerned had it occurred on Python 3.x (instead of 2.x in this case).
Thanks @jbrockmendel !