Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
09b466b
make capsule api functions less generic by adding a namespace to prev…
Vizonex Jun 20, 2025
0b08ba3
missed a function let me fix it real fast...
Vizonex Jun 20, 2025
baf4e6a
lets add some documentation comments to these functions
Vizonex Jun 20, 2025
8356ff2
time to add a few more functions, I'm adding more shortly...
Vizonex Jun 20, 2025
c884dcb
Fill out more functions and concept ideas
Vizonex Jun 20, 2025
dc2bcc7
all the Multidict Object API Next will be istr...
Vizonex Jun 21, 2025
904fb82
reformat with clang-format
Vizonex Jun 21, 2025
0ebbdf1
add more functions to testcapi :)
Vizonex Jun 21, 2025
ecd898c
add contribution to changes folder
Vizonex Jun 21, 2025
efa70f5
Revert namespace idea unsure if it actually will cause compiling issues
Vizonex Jun 21, 2025
9036575
Revert namespace idea unsure if it actually will cause compiling issues
Vizonex Jun 21, 2025
17b560d
I kept my good old backups
Vizonex Jun 21, 2025
4e08873
fix compiling with previously proposed api
Vizonex Jun 21, 2025
c04d584
discovered that md_new(...) is causing segfaults, gonna need to inves…
Vizonex Jun 21, 2025
6c80da6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
721b593
Adding a reference count by 1 solves the segfault
Vizonex Jun 21, 2025
670fe1d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
233545f
Now that we know a bit more about refs let's change a few of these
Vizonex Jun 21, 2025
d6c10a7
Ensure MultiDict_Del throws exception when key not found
Vizonex Jun 21, 2025
3d2e83a
add test_del
Vizonex Jun 21, 2025
1a8e629
Merge branch 'capi' of https://github.com/Vizonex/multidict into capi
Vizonex Jun 21, 2025
c533610
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
96d1b96
small fixes
Vizonex Jun 21, 2025
9b34eef
almost screwed up thanks to precommit
Vizonex Jun 21, 2025
5927152
Merge branch 'capi' of https://github.com/Vizonex/multidict into capi
Vizonex Jun 21, 2025
98f0144
run reformatter
Vizonex Jun 21, 2025
b7208da
add few more tests if I haven't yet done so
Vizonex Jun 21, 2025
1e97e03
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
756e331
use precommit suggestions
Vizonex Jun 21, 2025
a9ec875
revert
Vizonex Jun 21, 2025
b4239ac
whoops I forgot to remove
Vizonex Jun 21, 2025
2eb9032
mypy fixes
Vizonex Jun 21, 2025
3bb5a74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
04c2f83
Merge branch 'capi' into capi
asvetlov Jun 21, 2025
3b03439
all tests added we can begin debugging soon...
Vizonex Jun 21, 2025
164be59
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
da32a5e
ALL OF THEM WORK!!!!
Vizonex Jun 21, 2025
d691d6d
Merge branch 'capi' of https://github.com/Vizonex/multidict into capi
Vizonex Jun 21, 2025
1a56fc5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2025
0c73888
reformat incase I haven't already done so
Vizonex Jun 21, 2025
8f94d17
Merge branch 'capi' of https://github.com/Vizonex/multidict into capi
Vizonex Jun 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1185.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added MultiDict Functions to C-API -- by ``@Vizonex``.
14 changes: 14 additions & 0 deletions multidict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
several values for the same key.
"""

import pathlib
from typing import TYPE_CHECKING

from ._abc import MultiMapping, MutableMultiMapping
Expand All @@ -20,6 +21,7 @@
"upstr",
"istr",
"getversion",
"get_include",
)

__version__ = "6.5.1.dev0"
Expand Down Expand Up @@ -57,3 +59,15 @@


upstr = istr

# Inspired by Numpy


def get_include() -> str:
"""
Get multidict headers for compiling
multidict with other C Extensions or
cython code
"""

return str(pathlib.Path(__file__).parent)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two options here.

  1. Drop the method, document import multidict, include_path=multidict.__path__ as I did in testcapi/setup.py
  2. Keep the function but return bare __path__; pathlib usage is redundant here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asvetlov There was an issue when I tried compiling it but it may have been a configuration problem on my end so met let me go back and revert this change.

Loading