New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Birth year #15
Comments
@stef-iula do you have any idea regarding how to solve this problem? |
@fabiocaccamo to be honest I haven't looked yet into your code nor in any of the other packages that do this to understand how to fix the issue, but I'll keep you posted! I opened the issue because I think it's good to have a reference! |
@stef-iula my question doesn't require that you read the code, because the problem is that from the "Codice Fiscale" it is possible to obtain only the last 2 digits of the year, so it is impossible to distinguish if 21 means 1921 or 2021. |
I am aware of how it works and the fact that this basically has to be modulo 100 yrs but I tried one of these corner cases on this website https://www.codicefiscale.com/inverso.php and it worked properly so I was wondering if there's a way solving it. |
Using https://www.codicefiscale.com/inverso.php try to generate your own CF twice, the first time with birthdate year 1921 and the second time with year 2021, you will obtain the same code... Probably they do just the opposite (they do precedence to the older year), but the problem is the same. |
I tried decoding several times the CF that gave me problems (I can't share for privacy reasons) and I always got the right result -- 1921 as birth year. |
Sure, but if you would decode the code of a child born in 2021, you will obtain 1921 anyway, there is not solution. |
I see.. well, hopefully it's about corner cases so I'd better find a way to handle them in my app. Thanks a lot for the discussion, closing this since there appears to be no solution :) |
Yes, it is really a corner case. |
Python version
3.8.6
Package version
0.3.7
Current behavior (bug description)
Tax codes with "21" as birth year are decoded as 2021
Expected behavior
Tax codes with "21" as birth year decoded correctly as 1921 or 2021
The text was updated successfully, but these errors were encountered: