Nykakin / chompjs

Parsing JavaScript objects into Python data structures
MIT License
197 stars 11 forks source link

Fix compilation on windows #49

Closed Nykakin closed 1 year ago

Nykakin commented 1 year ago

Resolving https://github.com/Nykakin/chompjs/issues/48

When I've looked to some tutorial as to how to write an generator in C API I've found a blogpost that used following way to initialize Python type object head:

PyVarObject_HEAD_INIT(&PyType_Type, 0)

According to this this should be:

PyVarObject_HEAD_INIT(NULL, 0)

Indeed, in the newer examples in docs NULL is always used. The warning that what we’d like to write is PyVarObject_HEAD_INIT(&PyType_Type, 0) was dropped in documentation since 3.6.