4 fix spelling & word choice
source | link

I want to be able to capture facts like Bob was born in 2000 and Bill's birthday is May 7th.

In both examples we know only part of the person's birthdatebirth date. In one case we know only the year; in the other case we know the month and day, but not the year.

How do I capture this information?

A few examples of how this might work:

Imagine a library like datetime which allowed None in the fields to represent unknowns. I might have code like the following:

date_a = date(2000, 5, None)
date_b = date(2000, 6, None)
difference = date_b - date_a
assert difference.min.days == 1
assert difference.max.days == 60  # Or something close to 60.
assert equal(date_a, date_b) == False

date_c = date(2000, 5, None)
assert equal(date_a, date_c) == Maybe

This is just an example of how it might behave. I don't necissarilynecessarily want this exactprecise behavior.

I want to be able to capture facts like Bob was born in 2000 and Bill's birthday is May 7th.

In both examples we know only part of the person's birthdate. In one case we know only the year; in the other case we know the month and day, but not the year.

How do I capture this information?

A few examples of how this might work:

Imagine a library like datetime which allowed None in the fields to represent unknowns. I might have code like the following:

date_a = date(2000, 5, None)
date_b = date(2000, 6, None)
difference = date_b - date_a
assert difference.min.days == 1
assert difference.max.days == 60  # Or something close to 60.
assert equal(date_a, date_b) == False

date_c = date(2000, 5, None)
assert equal(date_a, date_c) == Maybe

This is just an example of how it might behave. I don't necissarily want this exact behavior.

I want to be able to capture facts like Bob was born in 2000 and Bill's birthday is May 7th.

In both examples we know only part of the person's birth date. In one case we know only the year; in the other case we know the month and day, but not the year.

How do I capture this information?

A few examples of how this might work:

Imagine a library like datetime which allowed None in the fields to represent unknowns. I might have code like the following:

date_a = date(2000, 5, None)
date_b = date(2000, 6, None)
difference = date_b - date_a
assert difference.min.days == 1
assert difference.max.days == 60  # Or something close to 60.
assert equal(date_a, date_b) == False

date_c = date(2000, 5, None)
assert equal(date_a, date_c) == Maybe

This is just an example of how it might behave. I don't necessarily want this precise behavior.

    Tweeted twitter.com/#!/StackProgrammer/status/600430293305163777
3 edited title
| link

How do I model parts ofpartial dates in Python? Like an unknown year, or unknown day of the month?

    Post Undeleted by Buttons840
    Post Deleted by Buttons840
2 Removed resource request language.
source | link

Are there any Python libraries for How do I model parts of dates with unknownsin Python? Like an unknown year, or unknown day of the month?

I want to be able to capture facts like Bob was born in 2000 and Bill's birthday is May 7th.

In both examples we know only part of the person's birthdate. In one case we know only the year; in the other case we know the month and day, but not the year.

Are there any Python libraries that would helpHow do I capture this information? I can make my own, but if there are any widely use libraries I would prefer to use those.

A few examples of how this library might work:

Imagine a library like datetime which allowed None in the fields to represent unknowns. I might have code like the following:

date_a = date(2000, 5, None)
date_b = date(2000, 6, None)
difference = date_b - date_a
assert difference.min.days == 1
assert difference.max.days == 60  # Or something close to 60.
assert equal(date_a, date_b) == False

date_c = date(2000, 5, None)
assert equal(date_a, date_c) == Maybe

This is just an example of how such a libraryit might behave. I don't necissarily want this exact behavior.

Are there any Python libraries for dates with unknowns? Like an unknown year, or unknown day of the month?

I want to be able to capture facts like Bob was born in 2000 and Bill's birthday is May 7th.

In both examples we know only part of the person's birthdate. In one case we know only the year; in the other case we know the month and day, but not the year.

Are there any Python libraries that would help capture this information? I can make my own, but if there are any widely use libraries I would prefer to use those.

A few examples of how this library might work:

Imagine a library like datetime which allowed None in the fields to represent unknowns. I might have code like the following:

date_a = date(2000, 5, None)
date_b = date(2000, 6, None)
difference = date_b - date_a
assert difference.min.days == 1
assert difference.max.days == 60  # Or something close to 60.
assert equal(date_a, date_b) == False

date_c = date(2000, 5, None)
assert equal(date_a, date_c) == Maybe

This is just an example of how such a library might behave. I don't necissarily want this exact behavior.

How do I model parts of dates in Python? Like an unknown year, or unknown day of the month?

I want to be able to capture facts like Bob was born in 2000 and Bill's birthday is May 7th.

In both examples we know only part of the person's birthdate. In one case we know only the year; in the other case we know the month and day, but not the year.

How do I capture this information?

A few examples of how this might work:

Imagine a library like datetime which allowed None in the fields to represent unknowns. I might have code like the following:

date_a = date(2000, 5, None)
date_b = date(2000, 6, None)
difference = date_b - date_a
assert difference.min.days == 1
assert difference.max.days == 60  # Or something close to 60.
assert equal(date_a, date_b) == False

date_c = date(2000, 5, None)
assert equal(date_a, date_c) == Maybe

This is just an example of how it might behave. I don't necissarily want this exact behavior.

1
source | link