Repository: sympy/sympy
Pull request: Changed the name of the node visiting function from `visit_Num` to `visit_Constant`.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->
Fixes #23092 

#### Brief description of what is fixed or changed
I changed the name of the node visiting function `visit_Num` to `visit_Constant` because the former is deprecated since version 3.8.

#### Other comments

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* parsing
  * Changed the name of the `visit_Num` node visitor function to `visit_Constant`, as the former is deprecated.
<!-- END RELEASE NOTES -->


Problem statement:
ast_parser: PendingDeprecationWarning: visit_Num is deprecated; add visit_Constant
`sympy.parsing.ast_parser` triggers `PendingDeprecationWarning` in Python ≥ 3.8:
```console
$ python3 -Wd
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy.parsing.ast_parser import parse_expr
>>> parse_expr('6 * 7', {})
/usr/lib/python3.8/ast.py:371: PendingDeprecationWarning: visit_Num is deprecated; add visit_Constant
  return visitor(node)
42
```

Hints from issue discussion:
This should be easy for someone to fix. I think we still support 3.7 so it will need to have a branch.
I don't think there will be a problem, as the `Constant` Node type was [added in 3.6](https://greentreesnakes.readthedocs.io/en/latest/nodes.html#Constant), with plans to deprecate `Num` in 3.8.

Commit message: Reordered the `.mailmap` file.

Patch to review:
diff --git a/.mailmap b/.mailmap
index 24c64a770b39..a70905f4dcfa 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1141,6 +1141,7 @@ Tim Swast <tswast@gmail.com>
 Timothy Cyrus <tcyrus@users.noreply.github.com>
 Timothy Reluga <treluga@math.psu.edu> <tcr-public2@psu.edu>
 Timothy Reluga <treluga@math.psu.edu> me <none@none>
+Tirthankar Mazumder <63574588+wermos@users.noreply.github.com>
 TitanSnow <sweeto@live.cn>
 Tobias Lenz <t_lenz94@web.de>
 Tom Bachmann <e_mc_h2@web.de> <ness987@googlemail.com>
diff --git a/AUTHORS b/AUTHORS
index 3f356c42e94a..9038db2a8088 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -4,7 +4,7 @@ those who explicitly didn't want to be mentioned. People with a * next
 to their names are not found in the metadata of the git history. This
 file is generated automatically by running `./bin/authors_update.py`.
 
-There are a total of 1127 authors.
+There are a total of 1129 authors.
 
 Ondřej Čertík <ondrej@certik.cz>
 Fabian Pedregosa <fabian@fseoane.net>
@@ -1133,3 +1133,5 @@ Tom Fryers <61272761+TomFryers@users.noreply.github.com>
 Zouhair <zouhair.mahboubi@gmail.com>
 zzj <29055749+zjzh@users.noreply.github.com>
 shubhayu09 <guptashubhayu601@gmail.com>
+Siddhant Jain <siddhantashoknagar@gmail.com>
+Tirthankar Mazumder <63574588+wermos@users.noreply.github.com>
diff --git a/sympy/parsing/ast_parser.py b/sympy/parsing/ast_parser.py
index 7d1d3c3f3b08..253639d18eb2 100644
--- a/sympy/parsing/ast_parser.py
+++ b/sympy/parsing/ast_parser.py
@@ -32,7 +32,7 @@ def __init__(self, local_dict, global_dict):
         self.local_dict = local_dict
         self.global_dict = global_dict
 
-    def visit_Num(self, node):
+    def visit_Constant(self, node):
         if isinstance(node.n, int):
             return fix_missing_locations(Call(func=Name('Integer', Load()),
                     args=[node], keywords=[]))


Code review comments:
diff_hunk: @@ -4,7 +4,7 @@ those who explicitly didn't want to be mentioned. People with a * next
 to their names are not found in the metadata of the git history. This
 file is generated automatically by running `./bin/authors_update.py`.
 
-There are a total of 1127 authors.
+There are a total of 1129 authors.
path: AUTHORS
text: @user1:
This change should also be reverted.

diff_hunk: @@ -1133,3 +1133,5 @@ Tom Fryers <61272761+TomFryers@users.noreply.github.com>
 Zouhair <zouhair.mahboubi@gmail.com>
 zzj <29055749+zjzh@users.noreply.github.com>
 shubhayu09 <guptashubhayu601@gmail.com>
+Siddhant Jain <siddhantashoknagar@gmail.com>
+Tirthankar Mazumder <63574588+wermos@users.noreply.github.com>
path: AUTHORS
text: @user1:
The changes to the AUTHORS file should be reverted. The AUTHORS file will be updated automatically at the time of the next release based on the information in the .mailmap file.