GitXplorerGitXplorer
g

DateType

public
78 stars
6 forks
1 issues

Commits

List of commits on branch trunk.
Unverified
7a094225f273b6861bbb5495b26150b7c64dedc8

version bump for 2024.2.28

gglyph committed a year ago
Unverified
7f8ac95f863a74c78ad6bd9ffad4ac56acbe5db2

add year/month/day attributes to DateTime

gglyph committed a year ago
Unverified
d408474781566403885ae3f1b44f8c93906af561

it's seen some real-world use, it has CI, let's bump that development status

gglyph committed a year ago
Unverified
428b1f0fd245e5e3bcdd6ee339d738438568f734

oops

gglyph committed a year ago
Verified
b993060b95155e0a98cc60dfe826ed7a1a948f9e

Merge pull request #7 from m-aciek/3.7-support

gglyph committed a year ago
Unverified
6e433282bf6e1306ac13b14835d612796204f4be

`lint` only needs to run on the latest CPython

gglyph committed a year ago

README

The README file for this repository.

DateType

A Workaround

DateType is a workaround for this bug to demonstrate that we could have a type-checking-time wrapper for datetime that doesn't change (or almost doesn't change) the implementation, but fixes up two very annoying behaviors of the stdlib datetime module:

  1. a datetime now won't type-check as a date - it still inherits at runtime (the implementation is, after all, not changed) but it doesn't inherit at type-time.

  2. there are separate types for naive and aware datetimes.

There's a very small bit of implementation glue (concrete @classmethods for construction on the Naive and Aware types, and a few functions that do runtime checks to convert to/from stdlib types).