File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ Release notes
1111Unreleased
1212----------
1313
14+ Breaking changes
15+ ~~~~~~~~~~~~~~~~
16+ * `Zstd.default_level `, `Zstd.min_level `, and `Zstd.max_level ` are now class methods
17+ instead of properties. This means they must now be called like ``Zstd.default_level() ``
18+ instead of ``Zstd.default_level ``. This breaking change has been made because Python 3.13
19+ removes support for class properties.
20+ By :user: `David Stansby <dstansby> `
21+
1422Enhancements
1523~~~~~~~~~~~~
1624
Original file line number Diff line number Diff line change @@ -90,6 +90,6 @@ def test_checksum():
9090
9191def test_native_functions ():
9292 # Note, these assertions might need to be changed for new versions of zstd
93- assert Zstd .default_level == 3
94- assert Zstd .min_level == - 131072
95- assert Zstd .max_level == 22
93+ assert Zstd .default_level () == 3
94+ assert Zstd .min_level () == - 131072
95+ assert Zstd .max_level () == 22
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ cdef extern from "zstd.h":
2828
2929 ZSTD_CCtx* ZSTD_createCCtx() nogil
3030 size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx) nogil
31- size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx,
32- ZSTD_cParameter param,
31+ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx,
32+ ZSTD_cParameter param,
3333 int value) nogil
3434
3535 size_t ZSTD_compress2(ZSTD_CCtx* cctx,
@@ -235,7 +235,7 @@ class Zstd(Codec):
235235 """
236236
237237 codec_id = ' zstd'
238-
238+
239239 # Note: unlike the LZ4 and Blosc codecs, there does not appear to be a (currently)
240240 # practical limit on the size of buffers that Zstd can process and so we don't
241241 # enforce a max_buffer_size option here.
@@ -259,19 +259,16 @@ class Zstd(Codec):
259259 return r
260260
261261 @classmethod
262- @property
263262 def default_level (cls ):
264263 """ Returns the default compression level of the underlying zstd library."""
265264 return ZSTD_defaultCLevel()
266265
267266 @classmethod
268- @property
269267 def min_level (cls ):
270268 """ Returns the minimum compression level of the underlying zstd library."""
271269 return ZSTD_minCLevel()
272270
273271 @classmethod
274- @property
275272 def max_level (cls ):
276273 """ Returns the maximum compression level of the underlying zstd library."""
277274 return ZSTD_maxCLevel()
You can’t perform that action at this time.
0 commit comments