Follow-Up To #17875
State: closed

flake8 cleanup

use abbreviated dtstruct conversion functions

import from the cython versions of the stdlib instead of from src/datetime.pxd where possible.

Labels:
name: Datetime
description: Datetime data dtype
name: Code Style
description: Code style, linting, code_checks

Comments:
so obviously you are linting these with some settings. pls add those to lint.sh if some files are not fixed, that is ok, just put them in a separate list with the current options. fixing things, but not changing the tests is ok, but doesn't prevent changes to these or help others.
Just amended the lint.sh file.  Somehow [this](https://www.youtube.com/watch?v=R1cdJmDZMQw) mental image comes to mind.
@jbrockmendel hahah, great!
One Travis env has a TestClipboard error, the other...

```
Linting *.pyx
pandas/_libs/algos.pyx:261:1: E265 block comment should start with '# '
pandas/_libs/algos.pyx:325:1: E265 block comment should start with '# '
pandas/_libs/algos.pyx:390:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/groupby.pyx:28:1: E265 block comment should start with '# '
pandas/_libs/hashing.pyx:96:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/hashing.pyx:111:30: E222 multiple spaces after operator
pandas/_libs/index.pyx:42:13: W503 line break before binary operator
pandas/_libs/index.pyx:125:43: E261 at least two spaces before inline comment
pandas/_libs/index.pyx:479:33: E127 continuation line over-indented for visual indent
pandas/_libs/index.pyx:486:38: E127 continuation line over-indented for visual indent
pandas/_libs/interval.pyx:44:13: W503 line break before binary operator
pandas/_libs/interval.pyx:45:13: W503 line break before binary operator
pandas/_libs/join.pyx:150:27: E127 continuation line over-indented for visual indent
pandas/_libs/parsers.pyx:141:29: E261 at least two spaces before inline comment
pandas/_libs/parsers.pyx:403:9: E265 block comment should start with '# '
pandas/_libs/parsers.pyx:522:9: E265 block comment should start with '# '
pandas/_libs/parsers.pyx:760:23: W503 line break before binary operator
pandas/_libs/parsers.pyx:813:54: E127 continuation line over-indented for visual indent
pandas/_libs/parsers.pyx:851:14: E261 at least two spaces before inline comment
pandas/_libs/parsers.pyx:1377:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/parsers.pyx:1420:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/parsers.pyx:1785:33: E127 continuation line over-indented for visual indent
pandas/_libs/parsers.pyx:1806:29: E127 continuation line over-indented for visual indent
pandas/_libs/parsers.pyx:2266:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/parsers.pyx:2365:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/period.pyx:112:1: E265 block comment should start with '# '
pandas/_libs/period.pyx:170:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/period.pyx:280:31: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:282:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:284:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:286:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:291:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:292:15: W503 line break before binary operator
pandas/_libs/period.pyx:292:38: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:294:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:296:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:298:33: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:300:34: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:302:34: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:304:34: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:732:14: E261 at least two spaces before inline comment
pandas/_libs/period.pyx:1150:25: E127 continuation line over-indented for visual indent
pandas/_libs/period.pyx:1151:25: E127 continuation line over-indented for visual indent
pandas/_libs/sparse.pyx:331:27: E261 at least two spaces before inline comment
pandas/_libs/sparse.pyx:489:18: E261 at least two spaces before inline comment
pandas/_libs/sparse.pyx:632:23: E261 at least two spaces before inline comment
pandas/_libs/window.pyx:1385:34: E127 continuation line over-indented for visual indent
pandas/_libs/lib.pyx:85:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/lib.pyx:119:1: E265 block comment should start with '# '
pandas/_libs/lib.pyx:122:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/lib.pyx:128:26: E261 at least two spaces before inline comment
pandas/_libs/lib.pyx:189:13: W503 line break before binary operator
pandas/_libs/lib.pyx:192:13: W503 line break before binary operator
pandas/_libs/lib.pyx:193:13: W503 line break before binary operator
pandas/_libs/lib.pyx:194:13: W503 line break before binary operator
pandas/_libs/lib.pyx:195:13: W503 line break before binary operator
pandas/_libs/lib.pyx:196:13: W503 line break before binary operator
pandas/_libs/lib.pyx:197:13: W503 line break before binary operator
pandas/_libs/lib.pyx:198:13: W503 line break before binary operator
pandas/_libs/lib.pyx:993:23: E261 at least two spaces before inline comment
pandas/_libs/lib.pyx:1050:7: E271 multiple spaces after keyword
pandas/_libs/lib.pyx:1054:1: E265 block comment should start with '# '
pandas/_libs/lib.pyx:1139:11: E261 at least two spaces before inline comment
pandas/_libs/lib.pyx:1288:20: E261 at least two spaces before inline comment
pandas/_libs/lib.pyx:1290:22: E261 at least two spaces before inline comment
pandas/_libs/lib.pyx:1796:17: E129 visually indented line with same indent as next logical line
pandas/_libs/tslib.pyx:422:36: E241 multiple spaces after ','
pandas/_libs/tslib.pyx:621:28: E222 multiple spaces after operator
pandas/_libs/tslib.pyx:765:17: W503 line break before binary operator
pandas/_libs/tslib.pyx:766:17: W503 line break before binary operator
pandas/_libs/tslib.pyx:984:66: W291 trailing whitespace
pandas/_libs/tslib.pyx:1024:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/tslib.pyx:1265:34: E127 continuation line over-indented for visual indent
pandas/_libs/tslib.pyx:1353:17: W503 line break before binary operator
pandas/_libs/tslib.pyx:1438:5: E129 visually indented line with same indent as next logical line
pandas/_libs/tslib.pyx:1524:19: E271 multiple spaces after keyword
pandas/_libs/tslib.pyx:1675:5: E129 visually indented line with same indent as next logical line
pandas/_libs/tslib.pyx:2024:5: E129 visually indented line with same indent as next logical line
pandas/_libs/tslib.pyx:2024:17: W503 line break before binary operator
pandas/_libs/tslib.pyx:2292:11: E271 multiple spaces after keyword
pandas/_libs/tslib.pyx:2371:26: E261 at least two spaces before inline comment
pandas/_libs/tslib.pyx:2466:18: W503 line break before binary operator
pandas/_libs/tslib.pyx:2545:29: E127 continuation line over-indented for visual indent
pandas/_libs/tslib.pyx:2731:5: E301 expected 1 blank line, found 0
pandas/_libs/tslib.pyx:2886:21: W503 line break before binary operator
pandas/_libs/tslib.pyx:3017:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/src/reduce.pyx:1:1: E265 block comment should start with '# '
pandas/_libs/src/reduce.pyx:515:31: E261 at least two spaces before inline comment
pandas/_libs/src/reduce.pyx:535:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/src/inference.pyx:170:17: W503 line break before binary operator
pandas/_libs/src/inference.pyx:452:13: E129 visually indented line with same indent as next logical line
pandas/_libs/tslibs/fields.pyx:43:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/fields.pyx:44:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/fields.pyx:45:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/fields.pyx:46:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/fields.pyx:47:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/fields.pyx:48:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/fields.pyx:49:29: E261 at least two spaces before inline comment
pandas/_libs/tslibs/frequencies.pyx:166:5: E123 closing bracket does not match indentation of opening bracket's line
pandas/_libs/tslibs/parsing.pyx:51:1: E305 expected 2 blank lines after class or function definition, found 1
pandas/_libs/tslibs/parsing.pyx:202:44: E127 continuation line over-indented for visual indent
pandas/_libs/tslibs/parsing.pyx:233:38: W503 line break before binary operator
pandas/_libs/tslibs/parsing.pyx:237:40: W503 line break before binary operator
pandas/_libs/tslibs/parsing.pyx:245:38: W503 line break before binary operator
pandas/_libs/tslibs/parsing.pyx:252:38: W503 line break before binary operator
pandas/_libs/tslibs/parsing.pyx:320:31: E261 at least two spaces before inline comment
pandas/_libs/tslibs/parsing.pyx:393:1: E265 block comment should start with '# '
pandas/_libs/tslibs/parsing.pyx:407:28: E261 at least two spaces before inline comment
pandas/_libs/tslibs/parsing.pyx:452:28: E261 at least two spaces before inline comment
pandas/_libs/tslibs/parsing.pyx:509:9: E129 visually indented line with same indent as next logical line
pandas/_libs/tslibs/parsing.pyx:528:1: E265 block comment should start with '# '
pandas/_libs/tslibs/timedeltas.pyx:226:5: E129 visually indented line with same indent as next logical line
pandas/_libs/tslibs/timedeltas.pyx:226:13: W503 line break before binary operator
pandas/_libs/tslibs/timezones.pyx:159:1: E265 block comment should start with '# '
pandas/_libs/tslibs/timezones.pyx:177:5: E129 visually indented line with same indent as next logical line
pandas/_libs/tslibs/timezones.pyx:177:13: W503 line break before binary operator
pandas/_libs/tslibs/timezones.pyx:249:50: E261 at least two spaces before inline comment
pandas/_libs/tslibs/conversion.pyx:210:30: W503 line break before binary operator
pandas/_libs/tslibs/conversion.pyx:250:30: E127 continuation line over-indented for visual indent
pandas/_libs/tslibs/conversion.pyx:250:30: W503 line break before binary operator
pandas/_libs/tslibs/conversion.pyx:417:47: E261 at least two spaces before inline comment
pandas/_libs/tslibs/strptime.pyx:112:37: E127 continuation line over-indented for visual indent
pandas/_libs/tslibs/strptime.pyx:173:35: E127 continuation line over-indented for visual indent
pandas/_libs/tslibs/strptime.pyx:208:17: E265 block comment should start with '# '
pandas/_libs/tslibs/strptime.pyx:209:17: E265 block comment should start with '# '
pandas/_libs/tslibs/strptime.pyx:308:18: E261 at least two spaces before inline comment
pandas/_libs/tslibs/strptime.pyx:473:49: E127 continuation line over-indented for visual indent
pandas/_libs/tslibs/strptime.pyx:546:13: E265 block comment should start with '# '
pandas/_libs/tslibs/strptime.pyx:614:20: E261 at least two spaces before inline comment
pandas/_libs/tslibs/strptime.pyx:625:27: E241 multiple spaces after ','
pandas/io/msgpack/_packer.pyx:2:1: E265 block comment should start with '# '
pandas/io/msgpack/_unpacker.pyx:2:1: E265 block comment should start with '# '
pandas/io/msgpack/_unpacker.pyx:23:28: E261 at least two spaces before inline comment
pandas/io/msgpack/_unpacker.pyx:103:47: E261 at least two spaces before inline comment
pandas/io/msgpack/_unpacker.pyx:260:52: E261 at least two spaces before inline comment
pandas/io/msgpack/_unpacker.pyx:470:5: E265 block comment should start with '# '
pandas/io/msgpack/_unpacker.pyx:473:5: E265 block comment should start with '# '
```

I'm happy to clean these up, but doubt you want a giant sprawling PR.
Reverted the lint.sh changes in the hopes of actually closing this out; opening a separate PR with the lint changes shortly.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=h1) Report
> Merging [#18043](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c65a0f554b0381ac3f50762050a56bcff188ffa1?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18043      +/-   ##
==========================================
+ Coverage   91.24%   91.25%   +<.01%     
==========================================
  Files         163      163              
  Lines       50114    50114              
==========================================
+ Hits        45729    45732       +3     
+ Misses       4385     4382       -3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.06% <ø> (+0.02%)` | :arrow_up: |
| #single | `40.24% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.75% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.2% <0%> (+1.81%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18043?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/18043?src=pr&el=footer). Last update [c65a0f5...4b09c96](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=h1) Report
> Merging [#18043](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/c65a0f554b0381ac3f50762050a56bcff188ffa1?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18043      +/-   ##
==========================================
+ Coverage   91.24%   91.25%   +<.01%     
==========================================
  Files         163      163              
  Lines       50114    50114              
==========================================
+ Hits        45729    45732       +3     
+ Misses       4385     4382       -3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.06% <ø> (+0.02%)` | :arrow_up: |
| #single | `40.24% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.75% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.2% <0%> (+1.81%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18043?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/18043?src=pr&el=footer). Last update [c65a0f5...4b09c96](https://codecov.io/gh/pandas-dev/pandas/pull/18043?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

this is fine, you can lint in the other PR.