Commit Graph

58 Commits

Author SHA1 Message Date
mejrs 6f1cf1b662 Add more lints 2022-03-23 08:07:28 +01:00
David Hewitt ddf13ea98f clippy: enable some more lints 2022-03-03 07:23:28 +00:00
David Hewitt 6433d884fc dev: remove self dev dependency 2021-12-08 07:48:58 +00:00
David Hewitt 4b2345fe80 pymethods: support __call__ proto 2021-10-23 00:06:46 +01:00
Ashley Anderson bf26daec2d
Positional-only args (#1925)
* Add support for positional-only args

* Update changelog. Add a few more tests. Run rust-fmt.

* Fix test.

* Fix tests again.

* Update CHANGELOG.md to link PR instead of issue

* Update guide to mention positional-only params

* Add unreachable!() per code review

* Update and expand tests for pos args.

* Fix tests, lint, add UI tests.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-10-19 23:13:27 +01:00
scalexm 7e8eeec02f Add a test 2021-06-25 00:18:53 +02:00
David Hewitt ce851ad7d9 1506: fixes to macro hygiene 2021-03-28 11:01:51 +01:00
David Hewitt e34e87ad4a 1505: add CHANGELOG and test 2021-03-20 08:36:19 +00:00
kngwyu 9b88a452e2 Refactor tests to use shorter macros 2021-03-14 23:43:53 +09:00
David Hewitt 29a525b327 pyfunction: refactor argument extraction 2021-03-01 17:49:46 +00:00
David Hewitt ffd5874c3a pyfunction: fix args conflicting with keyword only arg 2021-03-01 17:49:46 +00:00
David Hewitt b2675b11fe rust 1.50: clippy and lint fixes 2021-02-11 22:03:34 +00:00
David Hewitt 9807ef8ed4 macros-backend: fix raw idents in pymethods 2021-01-12 22:01:11 +00:00
Alex Gaynor 140790b15f Merge branch 'master' into abi3-merge-master 2020-10-10 10:11:49 -04:00
dvermd df984ec8df
Keyword only arguments (#1209)
* allow keyword arguments without default value

* allow keyword-only arguments
2020-10-01 13:34:54 +09:00
Alex Gaynor 117f60bed0 Make PyType::name abi3 compatible
The implementation is more complex, because there's no equivalent to tp_name in the limited API
2020-09-08 12:22:59 -04:00
kngwyu f5f2e84f4b Enable &Self in #[pymethods] again 2020-07-28 20:55:38 +09:00
David Hewitt 4ed9748b45 Rename exceptions to PyException etc; reintroduce deprecated ones 2020-07-18 06:02:57 +01:00
kngwyu 1e39071c04 Retrieve FromPyObject implementation for &PySequence 2020-03-22 20:00:21 +09:00
kngwyu cea707dd1c Inhibit positional args after * 2020-03-06 14:01:27 +09:00
kngwyu 25069baef4 Fix the interpretation of '*' 2020-03-04 23:48:46 +09:00
kngwyu 96115eaaaa Refactor some tests in test_methods 2020-03-04 20:35:46 +09:00
kngwyu bbe4393b1e Add more tests in method_with_pyclassarg 2020-03-04 20:25:30 +09:00
kngwyu e63e0cbf5a Make it enable to take &PyClass as arguments as pyfunctions/methods 2020-03-04 13:37:26 +09:00
kngwyu 2fd2185052 Merge branch 'master' into pycell 2020-02-17 00:07:15 +09:00
kngwyu 8f8b42591a Fix PySelf and AsPyRef 2020-02-16 23:54:55 +09:00
David Hewitt d5509424b2 Make #[pymethods] aware of #[cfg] 2020-02-15 14:07:48 +00:00
kngwyu a2408cacbb Rename PyClassShell with PyCell 2020-02-08 15:05:13 +09:00
kngwyu a6639076b9 Introduce PyInternalCaster 2019-12-14 23:16:39 +09:00
Alexander Niederbühl e91d969e17 Make tests for optional arguments more consistent 2019-10-13 23:17:57 +02:00
Alexander Niederbühl c7a53611e0 Enable to give None as default value for an argument 2019-10-12 20:16:25 +02:00
Georg Brandl cba1657460 Adjust the varargs/kwds objects to remove arguments consumed by parameters
Also fix some other validation issues and add more tests.

fixes #420
2019-06-16 22:13:50 +09:00
kngwyu 0f9a3b1194 Expose py_run macro 2019-06-13 18:18:06 +09:00
kngwyu cf689840ef Allow lifetime in pymethods 2019-04-26 14:28:29 +09:00
Martin Larralde edd2fba2d6 Add tests for quotes in class/method documentation 2019-04-15 01:29:13 +02:00
Martin Larralde 569a7e9e95 Add more tests for `#[pymethods]` docstrings 2019-04-13 23:25:45 +02:00
Miles Granger 711155d7ad Update tests & docs with IntoPyDict::into_py_dict(py) 2019-03-20 20:04:00 +01:00
konstin 6cd07c369c Simpler new and clippy fixes 2019-02-23 18:38:00 +01:00
konstin 6cb098ee12 Replace py.init_[ref|mut] with Py[Ref|Mut]::new 2019-02-13 21:52:21 +01:00
konstin 1a489d2829 Make the init methods use a value instead of a function 2019-02-13 13:59:47 +01:00
konstin 9e53418aad Less feature(specialization) 2019-02-01 18:09:51 +01:00
konstin 936f0153e8 Migrate to rust 2018 2019-02-01 14:23:29 +01:00
konstin 57afb51604 Remove PyToken completely; Fixes #94 2018-11-12 14:42:21 +01:00
konstin fb2349b6ec Remove PyToken usages from tests 2018-11-12 14:41:29 +01:00
konstin 3a95d163ca New rustfmt version
You might need to upgrade to the latest nightly to get the same results
2018-09-28 23:34:57 +02:00
konstin 302c099a76 Big refactoring to shrink the prelude 2018-09-21 23:34:28 +02:00
konstin f58549f1d8 Get rid of a bunch of PyTokens 2018-09-02 23:33:45 +02:00
konstin 7c0379b13a Remove many specialization uses
From over a hundret "default fn" uses down to 17
2018-08-25 20:48:17 +02:00
konstin db4a2d9017 Get rid of the pyobject_extract macro 2018-08-20 22:53:43 +02:00
konstin 991a8b94d2 More nightly fixes 2018-08-19 20:42:17 +02:00