Make PyTorch Python 3.8 compatible (#29302)
Summary:
PEP 590 modifies the `tp_print` offset to `tp_vectorcall_offset` - which requires a Py_ssize_t object.
Passing a nullptr caused compatibility issues for Python 3.8.
Changelog:
- Modify all occurrences of `nullptr /* tp_print */` to 0 /* tp_vectorcall_offset */
- Minor formatting changes
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29302
Test Plan:
- Local fresh build with Python 3.8 completed successfully.
Fixes https://github.com/pytorch/pytorch/issues/28060.
Fixes https://github.com/pytorch/pytorch/issues/29162.
Supersedes https://github.com/pytorch/pytorch/pull/28364
Differential Revision: D18372022
Pulled By: ezyang
fbshipit-source-id: 8e9a15b0d0f72101ccc69bd489f5efa216b880bb