Commit Graph

50 Commits

Author SHA1 Message Date
Jeong YunWon
cb2a994b46 Result<T, PyObjectRef> -> PyResult<T> 2019-10-11 18:09:55 +09:00
Daniel Alley
a6fcc664bd Use new style for PyZip impl 2019-10-04 13:35:36 -04:00
Noah
a429b09a0b Allow match_class match expressions without parens around the target 2019-09-19 20:07:18 +00:00
Noah
dfeeda1c4c Match an actual match expression in match_class! 2019-09-19 18:27:34 +00:00
coolreader18
6a34a720e4 Update dependencies 2019-09-10 21:53:53 -05:00
coolreader18
d33d5ce5f6 Initialize attributes on new modules 2019-08-15 23:06:30 -05:00
coolreader18
8dae17ac99 Add Match methods 2019-08-08 17:41:39 -05:00
Jeong YunWon
7f2560c9e1 Add str.encode for utf-8 2019-05-29 21:25:34 +09:00
Maxim Kurnikov
737ec52365 simplify PyFuncArgs get_kwarg/get_optional_kwarg with cloned() 2019-05-22 12:47:28 +03:00
Maxim Kurnikov
b5352da2c0 fix formatting 2019-05-22 03:30:30 +03:00
Maxim Kurnikov
0098e8485a move PyFuncArgs.kwargs to IndexMap 2019-05-22 03:18:15 +03:00
Yonatan Goldschmidt
84684e5f7d Don't use RefCell in tuple object 2019-05-19 23:57:32 +03:00
ben
90711f10a0 Accept tuple for first arg in str.startswith and str.endswith 2019-05-12 13:14:27 +12:00
Adam Kelly
cad4a13cf7 Add utility methods for default optional args. 2019-04-25 09:07:17 +01:00
ben
f2873a519d Merge branch 'master' into slice_new
# Conflicts:
#	tests/snippets/builtin_slice.py
#	vm/src/frame.rs
#	vm/src/obj/objrange.rs
#	vm/src/obj/objslice.rs
2019-04-17 19:44:46 +12:00
ben
6650ad895a Fix a bunch of clippy warnings 2019-04-14 10:07:50 +12:00
Adam
78ab68a64e Merge pull request #817 from skinny121/function_metadata
Add __name__, __qualname__ and __module__ to functions and classes
2019-04-13 09:44:33 +01:00
Adrian Wielgosik
585e6e5428 Drop IntoPyNativeFunc impl to fix Nightly/Beta breakages. 2019-04-12 19:28:09 +02:00
ben
2164cb5e65 Produce correct value for __qualname__ and add attributes to class. 2019-04-11 20:13:23 +12:00
Joey Hain
be55562457 Allow first argument to be a shared ref to a python value 2019-04-06 18:50:40 -07:00
ben
a49895ef63 Cleanup slice_new and added more slice tests 2019-03-31 09:58:02 +13:00
ben
b5dc5a28e7 Merge branch 'master' into int_new_args
# Conflicts:
#	vm/src/function.rs
2019-03-29 18:51:19 +13:00
ben
657d025592 Change syntax of attributes in FromArgs proc macro 2019-03-28 21:34:11 +13:00
Joey Hain
62842e6d19 convert some builtins 2019-03-27 19:01:13 -07:00
ben
3ca387b509 Enhance FromArgs derive proc macro to allow positional, and positional
or keyword arguments.
2019-03-28 05:55:15 +13:00
Joey Hain
cc4f3fdb40 Clean up TypeProtocol 2019-03-25 19:18:01 -07:00
Adam Kelly
bbb7162472 Various dictionary changes.
* vm.ctx.new_dict returns a PyDictRef
* Special case for module goes away.
* Instances get a real dictionary.
2019-03-25 16:37:20 +00:00
coolreader18
946103bca8 Merge branch 'master' into coolreader18/wasm-browser-dom 2019-03-23 20:12:26 -05:00
ben
6fa059fd6c Make PyObject.typ a PyClassRef 2019-03-24 10:51:52 +13:00
Joey
18ed00a653 Range cleanups 2019-03-23 12:48:37 -07:00
coolreader18
9050799cc4 Merge branch 'master' into coolreader18/wasm-browser-dom 2019-03-23 13:22:07 -05:00
coolreader18
a830d8e131 Add PyDocument and PyElement 2019-03-23 09:36:15 -05:00
ben
c1d5ce715f Change isinstance/issubclass to accept PyClassRef instead of PyCObject.
Also changed PyValue::class to return a PyClassRef.
2019-03-23 19:32:31 +13:00
Adam Kelly
66adc25201 objtype - replace AttributeProtocol access with class_get_attr. 2019-03-22 19:47:51 +00:00
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
coolreader18
f78f558404 Fix clippy lints 2019-03-19 10:52:39 -05:00
Joey
7cb889d42c Rebase against #693 and simplify 2019-03-16 16:38:28 -07:00
Joey
e83686cf3c Add clarifying note to KwArgs docs 2019-03-16 16:29:09 -07:00
Joey
d3b9714754 Convert print() builtin to new args style 2019-03-16 16:29:09 -07:00
Joey
7be5b8dafe FromArgs: use PyFuncArgs instead of iterator 2019-03-16 16:07:59 -07:00
Joey
60ed1bd0a7 Handle unexpected positional argument in KwArgs 2019-03-16 10:18:46 -07:00
Joey
7bfd2e6e84 Move function items out of pyobject module 2019-03-15 21:27:11 -07:00
Joey Hain
45bc8c8f7a Move PyRef to pyobject module 2019-03-10 13:01:46 -07:00
ben
7d01323e09 Merge branch 'master' into property_refactor
# Conflicts:
#	vm/src/function.rs
2019-03-10 09:06:21 +13:00
ben
0ec034df51 Change property.__new__ to use new style function and construct
PyProperty
2019-03-09 14:07:42 +13:00
Adrian Wielgosik
10531191bb Convert most tuple/list methods to new args style 2019-03-08 20:43:20 +01:00
Adrian Wielgosik
1601da0692 Migrate PyFloat to new method style 2019-03-07 19:47:16 +01:00
Adrian Wielgosik
e4e8b135ef Convert a bunch of string methods to new-args-style.
Mostly skipped the ones dealing with ints.
2019-03-05 20:41:02 +01:00
Joey Hain
4e822ed6cd Improve error messages and add docs for new native function machinery 2019-03-03 12:52:51 -08:00
Joey Hain
7f75e3ee8a Significant improvements to new function definition style
- PyRef<T> type for accepting references to payloads.
- Args<T> type for consuming remaining positional args
  (mirrors python `*args`).
- KwArgs<T> type for consuming remaining keyword args
  (mirrors python `*kwargs`).
- OptArg<T> type for consuming remaining keyword args
  (no python code equivalent, only possible in native functions like in cpython).
- PyIterable<T> for accepting an iterator over a sequence of Ts.
- Arity checking (but TypeError messages need work)
2019-02-27 19:53:20 -08:00