mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
In many "non-Python" headers, we include Python.h because we need to declare a pointer to PyObject, and solely because of that. It would be a lot better if we had a simpler version of Python.h that just declared PyObject available for pointers, without anything else. This is what torch/csrc/utils/python_stub.h does. The good thing about not including Python.h is that it is easy to be warning-less; no more ugly insertions of Python.h on headers where it has no good reason to be. This makes PyTorch warning clean again. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
5 lines
56 B
C
5 lines
56 B
C
#pragma once
|
|
|
|
struct _object;
|
|
typedef _object PyObject;
|