Skip to content

Commit 8dfe28b

Browse files
committed
Update repr output in readme examples to match revised implementation
1 parent 23620c7 commit 8dfe28b

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ earliest and latest possible dates for comparison purposes so you can
121121
sort dates and compare with equals, greater than, and less than. You
122122
can also compare with python `datetime.date` objects.
123123

124-
```python
124+
```Python console
125125
>>> november7_2020 = Undate(2020, 11, 7)
126126
>>> november_2001 = Undate(2001, 11)
127127
>>> year2k = Undate(2000)
128128
>>> ad100 = Undate(100)
129129
>>> sorted([november7_2020, november_2001, year2k, ad100])
130-
[<Undate 0100>, <Undate 2000>, <Undate 2001-11>, <Undate 2020-11-07>]
130+
[undate.Undate(year=100, calendar="Gregorian"), undate.Undate(year=2000, calendar="Gregorian"), undate.Undate(year=2001, month=11, calendar="Gregorian"), undate.Undate(year=2020, month=11, day=7, calendar="Gregorian")]
131131
>>> november7_2020 > november_2001
132132
True
133133
>>> year2k < ad100
@@ -161,17 +161,17 @@ and latest date as part of the range.
161161
```python
162162
>>> from undate import UndateInterval
163163
>>> UndateInterval(Undate(1900), Undate(2000))
164-
<UndateInterval 1900/2000>
164+
undate.UndateInterval(earliest=undate.Undate(year=1900, calendar="Gregorian"), latest=undate.Undate(year=2000, calendar="Gregorian"))
165165
>>> UndateInterval(Undate(1801), Undate(1900), label="19th century")
166+
undate.UndateInterval(earliest=undate.Undate(year=1801, calendar="Gregorian"), latest=undate.Undate(year=1900, calendar="Gregorian"), label="19th century")
166167
>>> UndateInterval(Undate(1801), Undate(1900), label="19th century").duration().days
167168
36524
168-
<UndateInterval '19th century' (1801/1900)>
169169
>>> UndateInterval(Undate(1901), Undate(2000), label="20th century")
170-
<UndateInterval '20th century' (1901/2000)>
170+
undate.UndateInterval(earliest=undate.Undate(year=1901, calendar="Gregorian"), latest=undate.Undate(year=2000, calendar="Gregorian"), label="20th century")
171171
>>> UndateInterval(latest=Undate(2000)) # before 2000
172-
<UndateInterval ../2000>
172+
undate.UndateInterval(latest=undate.Undate(year=2000, calendar="Gregorian"))
173173
>>> UndateInterval(Undate(1900)) # after 1900
174-
<UndateInterval 1900/>
174+
undate.UndateInterval(earliest=undate.Undate(year=1900, calendar="Gregorian"))
175175
>>> UndateInterval(Undate(1900), Undate(2000), label="19th century").duration().days
176176
36890
177177
>>> UndateInterval(Undate(2000, 1, 1), Undate(2000, 1,31)).duration().days
@@ -186,15 +186,15 @@ are "ISO8601" and "EDTF" and supported calendars.
186186
```python
187187
>>> from undate import Undate
188188
>>> Undate.parse("2002", "ISO8601")
189-
<Undate 2002>
189+
undate.Undate(year=2002, calendar="Gregorian")
190190
>>> Undate.parse("2002-05", "EDTF")
191-
<Undate 2002-05>
191+
undate.Undate(year=2002, month=5, calendar="Gregorian")
192192
>>> Undate.parse("--05-03", "ISO8601")
193-
<Undate --05-03>
193+
undate.Undate(month=5, day=3, calendar="Gregorian")
194194
>>> Undate.parse("--05-03", "ISO8601").format("EDTF")
195195
'XXXX-05-03'
196-
>>> Undate.parse("1800/1900")
197-
<UndateInterval 1800/1900>
196+
>>> Undate.parse("1800/1900", format="EDTF")
197+
undate.UndateInterval(earliest=undate.Undate(year=1800, calendar="Gregorian"), latest=undate.Undate(year=1900, calendar="Gregorian"))
198198
```
199199

200200
### Calendars
@@ -215,25 +215,25 @@ comparison across dates from different calendars.
215215
>>> from undate import Undate
216216
>>> tammuz4816 = Undate.parse("26 Tammuz 4816", "Hebrew")
217217
>>> tammuz4816
218-
<Undate '26 Tammuz 4816 Anno Mundi' 4816-04-26 (Hebrew)>
218+
undate.Undate(year=4816, month=4, day=26, label="26 Tammuz 4816 Anno Mundi", calendar="Hebrew")
219219
>>> rajab495 = Undate.parse("Rajab 495", "Islamic")
220220
>>> rajab495
221-
<Undate 'Rajab 495 Hijrī' 0495-07 (Islamic)>
221+
undate.Undate(year=495, month=7, label="Rajab 495 Islamic", calendar="Islamic")
222222
>>> y2k = Undate.parse("2001", "EDTF")
223223
>>> y2k
224-
<Undate 2001 (Gregorian)>
224+
undate.Undate(year=2001, calendar="Gregorian")
225225
>>> [str(d.earliest) for d in [rajab495, tammuz4816, y2k]]
226226
['1102-04-28', '1056-07-17', '2001-01-01']
227227
>>> [str(d.precision) for d in [rajab495, tammuz4816, y2k]]
228228
['MONTH', 'DAY', 'YEAR']
229229
>>> sorted([rajab495, tammuz4816, y2k])
230-
[<Undate '26 Tammuz 4816 Anno Mundi' 4816-04-26 (Hebrew)>, <Undate 'Rajab 495 Hijrī' 0495-07 (Islamic)>, <Undate 2001 (Gregorian)>]
230+
[undate.Undate(year=4816, month=4, day=26, label="26 Tammuz 4816 Anno Mundi", calendar="Hebrew"), undate.Undate(year=495, month=7, label="Rajab 495 Islamic", calendar="Islamic"), undate.Undate(year=2001, calendar="Gregorian")]
231231
```
232232

233233
---
234234

235-
For more examples, refer to the code notebooks included in the[examples]
236-
(https://github.com/dh-tech/undate-python/tree/main/examples/) in this
235+
For more examples, refer to the code notebooks included in the
236+
[examples](https://github.com/dh-tech/undate-python/tree/main/examples/) in this
237237
repository.
238238

239239
## Documentation

0 commit comments

Comments
 (0)