lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.13-6-gf5e0456

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.13-6-gf5e0456



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  f5e04567fd4196ef1f559f6d570baca618186662 (commit)
      from  8437b8e485f123811f2e432cb3ded5c94d315971 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=f5e04567fd4196ef1f559f6d570baca618186662

commit f5e04567fd4196ef1f559f6d570baca618186662
Author: Leon Sandøy <leon.haland@gmail.com>
Date:   Fri Jan 31 16:00:37 2020 +0100

    Fix misleading docstring in se.personnummer get_birth_date()
    
    The docstring for get_birth_date() in the Swedish personnummer.py warned
    that the datetime might be 100 years off because of the lack of
    precision in the personnummer.
    
    This was accurate when the docstring was written, but this is no longer
    accurate after the - and + signs were correctly handled.
    
    Fixes 5441ffa

diff --git a/stdnum/se/personnummer.py b/stdnum/se/personnummer.py
index 95d6180..8829ef7 100644
--- a/stdnum/se/personnummer.py
+++ b/stdnum/se/personnummer.py
@@ -3,6 +3,7 @@
 #
 # Copyright (C) 2018 Ilya Vihtinsky
 # Copyright (C) 2018-2020 Arthur de Jong
+# Copyright (C) 2020 Leon Sandøy
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -61,10 +62,13 @@ def compact(number):
 
 
 def get_birth_date(number):
-    """Guess the birth date from the number.
+    """Determine the birth date from the number.
 
-    Note that it may be 100 years off because the number has only the last
-    two digits of the year."""
+    For people aged 100 and up, the minus/dash in the personnummer is changed 
to a plus
+    on New Year's Eve the year they turn 100.
+
+    See Folkbokföringslagen (1991:481), §18.
+    """
     number = compact(number)
     if len(number) == 13:
         year = int(number[0:4])

-----------------------------------------------------------------------

Summary of changes:
 stdnum/se/personnummer.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
python-stdnum