Skip to content

Commit a6922ec

Browse files
committed
Add @SInCE annotations everywhere
1 parent 835738e commit a6922ec

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
NEXT_VERSION [..]
2+
----------------
3+
* `FromPy`/`ToPy` instances for text and bytestrings data types.
4+
15
0.1.1.1 [2025.03.10]
26
--------------------
37
* Crash of python's main thread when one attempts to interrupt it fixed.

src/Python/Inline/Literal.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ vectorToPy vec = runProgram $ do
540540
n_c = fromIntegral n :: CLLong
541541

542542

543-
-- | @since 0.1.2@. Converted to @bytes@
543+
-- | @since NEXT_VERSION@. Converted to @bytes@
544544
instance ToPy BS.ByteString where
545545
basicToPy bs = pyIO $ BS.unsafeUseAsCStringLen bs $ \(ptr,len) -> do
546546
let c_len = fromIntegral len :: CLLong
@@ -549,7 +549,7 @@ instance ToPy BS.ByteString where
549549
NULL -> unsafeRunPy mustThrowPyError
550550
_ -> return py
551551

552-
-- | @since 0.1.2@. Accepts @bytes@ and @bytearray@
552+
-- | @since NEXT_VERSION@. Accepts @bytes@ and @bytearray@
553553
instance FromPy BS.ByteString where
554554
basicFromPy py = pyIO $ do
555555
[CU.exp| int { PyBytes_Check($(PyObject* py)) } |] >>= \case
@@ -569,15 +569,15 @@ instance FromPy BS.ByteString where
569569
copyBytes hs_buf py_buf sz
570570
BS.unsafePackMallocCStringLen (hs_buf, sz)
571571

572-
-- | @since 0.1.2@. Converted to @bytes@
572+
-- | @since NEXT_VERSION@. Converted to @bytes@
573573
instance ToPy BL.ByteString where
574574
basicToPy = basicToPy . BL.toStrict
575575

576-
-- | @since 0.1.2@. Accepts @bytes@ and @bytearray@
576+
-- | @since NEXT_VERSION@. Accepts @bytes@ and @bytearray@
577577
instance FromPy BL.ByteString where
578578
basicFromPy = fmap BL.fromStrict . basicFromPy
579579

580-
580+
-- | @since NEXT_VERSION@.
581581
instance ToPy T.Text where
582582
-- NOTE: Is there ore efficient way to access
583583
basicToPy str = pyIO $ BS.unsafeUseAsCStringLen bs $ \(ptr,len) -> do
@@ -589,10 +589,11 @@ instance ToPy T.Text where
589589
where
590590
bs = T.encodeUtf8 str
591591

592+
-- | @since NEXT_VERSION@.
592593
instance ToPy TL.Text where
593594
basicToPy = basicToPy . TL.toStrict
594595

595-
596+
-- | @since NEXT_VERSION@.
596597
instance FromPy T.Text where
597598
basicFromPy py = pyIO $ do
598599
[CU.exp| int { PyUnicode_Check($(PyObject* py)) } |] >>= \case
@@ -603,6 +604,7 @@ instance FromPy T.Text where
603604
return $! T.decodeUtf8Lenient bs
604605
_ -> throwM BadPyType
605606

607+
-- | @since NEXT_VERSION@.
606608
instance FromPy TL.Text where
607609
basicFromPy = fmap TL.fromStrict . basicFromPy
608610

0 commit comments

Comments
 (0)