Skip to content

Commit 08ef4e3

Browse files
committed
Move chess.pgn.Game.headers docs
1 parent 60c21fc commit 08ef4e3

2 files changed

Lines changed: 21 additions & 22 deletions

File tree

chess/pgn.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -364,27 +364,7 @@ def __str__(self):
364364
class Game(GameNode):
365365
"""
366366
The root node of a game with extra information such as headers and the
367-
starting position.
368-
369-
By default the following 7 headers are provided in an ordered dictionary:
370-
371-
>>> game = chess.pgn.Game()
372-
>>> game.headers["Event"]
373-
'?'
374-
>>> game.headers["Site"]
375-
'?'
376-
>>> game.headers["Date"]
377-
'????.??.??'
378-
>>> game.headers["Round"]
379-
'?'
380-
>>> game.headers["White"]
381-
'?'
382-
>>> game.headers["Black"]
383-
'?'
384-
>>> game.headers["Result"]
385-
'*'
386-
387-
Also has all the other properties and methods of
367+
starting position. Also has all the other properties and methods of
388368
:class:`~chess.pgn.GameNode`.
389369
"""
390370

docs/pgn.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,26 @@ headers.
1414

1515
.. py:attribute:: headers
1616
17-
A `collections.OrderedDict()` of game headers.
17+
A :class:`collections.OrderedDict()` of game headers. By default the
18+
following 7 headers are provided:
19+
20+
>>> import chess.pgn
21+
>>>
22+
>>> game = chess.pgn.Game()
23+
>>> game.headers["Event"]
24+
'?'
25+
>>> game.headers["Site"]
26+
'?'
27+
>>> game.headers["Date"]
28+
'????.??.??'
29+
>>> game.headers["Round"]
30+
'?'
31+
>>> game.headers["White"]
32+
'?'
33+
>>> game.headers["Black"]
34+
'?'
35+
>>> game.headers["Result"]
36+
'*'
1837

1938
.. py:attribute:: errors
2039

0 commit comments

Comments
 (0)