Commit 0b4be8d
committed
[CPyCppyy] Don't re-implement
The newer C++ standards already implement a `contains()` method for
multiple STL classes. We can just forward to these in the `__contains__`
method for the Python proxy.
Forwarding to `contains()` on the C++ side means also that it will
become easier to implement classes that Pythonize nicely automatically.
Just as happened already before with `size()` (that got used to
automatically implement `__len__`), one just needs to implement
`contains()` on the C++ side now to implicitly get the `__contains__`
pythonization.contains() in Python if already present1 parent cffea8e commit 0b4be8d
File tree
4 files changed
+28
-1
lines changed- bindings/pyroot/cppyy
- CPyCppyy/src
- cppyy/test
4 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| 901 | + | |
901 | 902 | | |
902 | 903 | | |
903 | 904 | | |
| |||
924 | 925 | | |
925 | 926 | | |
926 | 927 | | |
| 928 | + | |
927 | 929 | | |
928 | 930 | | |
929 | 931 | | |
| |||
1266 | 1268 | | |
1267 | 1269 | | |
1268 | 1270 | | |
| 1271 | + | |
1269 | 1272 | | |
1270 | 1273 | | |
1271 | 1274 | | |
| |||
1282 | 1285 | | |
1283 | 1286 | | |
1284 | 1287 | | |
| 1288 | + | |
1285 | 1289 | | |
1286 | 1290 | | |
1287 | 1291 | | |
| |||
1654 | 1658 | | |
1655 | 1659 | | |
1656 | 1660 | | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
1657 | 1665 | | |
1658 | 1666 | | |
1659 | 1667 | | |
| |||
1885 | 1893 | | |
1886 | 1894 | | |
1887 | 1895 | | |
1888 | | - | |
| 1896 | + | |
| 1897 | + | |
1889 | 1898 | | |
| 1899 | + | |
1890 | 1900 | | |
1891 | 1901 | | |
1892 | 1902 | | |
1893 | 1903 | | |
1894 | 1904 | | |
1895 | 1905 | | |
1896 | 1906 | | |
| 1907 | + | |
| 1908 | + | |
1897 | 1909 | | |
| 1910 | + | |
1898 | 1911 | | |
1899 | 1912 | | |
1900 | 1913 | | |
| |||
1922 | 1935 | | |
1923 | 1936 | | |
1924 | 1937 | | |
| 1938 | + | |
| 1939 | + | |
1925 | 1940 | | |
| 1941 | + | |
1926 | 1942 | | |
1927 | 1943 | | |
1928 | 1944 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1868 | 1868 | | |
1869 | 1869 | | |
1870 | 1870 | | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
1871 | 1878 | | |
1872 | 1879 | | |
1873 | 1880 | | |
| |||
0 commit comments