Randall C. O'Reilly
5fb68318e0
generate longlong for gen_slice on windows
2024-05-03 15:27:38 -07:00
Randall C. O'Reilly
8e6808ae74
revert #353 -- doesn't work on CI or on my mac, on python 3.11 at least.
2024-05-03 14:50:32 -07:00
Randall O'Reilly
277bbad0c1
Merge pull request #353 from Inotart/master
...
Replacement c.long(size) for c.longlong(size)
2024-05-03 14:32:03 -07:00
我不是Art
69ffdd7010
Update gen_slice.go
2024-04-30 12:14:44 +08:00
Evan Oman
f16e21bc0e
Adds missing pointer reference for slices along with test
2024-04-22 21:39:40 -05:00
Randall C. O'Reilly
9dde3761d5
if renaming case, use lower-case string() method instead of String() -- fixes #337
2024-04-22 16:04:17 -07:00
Noam Kleinburd
e6a14f8cac
Implement efficient copies of bytes.
2023-12-13 11:20:35 +02:00
Rich Ramalho
8eddf46016
fix __next__ function
2023-10-02 21:26:08 -03:00
Noam Kleinburd
70048710c0
Add relevant parameters for pybindgen when a PyObject* is part of the function signature.
...
This occurs when dealing with a slice of complex numbers.
2022-11-13 15:59:40 +02:00
Randall C. O'Reilly
691b7e025e
major fix: create an import alias for package name conflicts -- e.g., adding goplot font package conflicts with image/font.. added pkgconflict test case
2021-08-29 02:55:02 -07:00
Justin Israel
625ea1c8f9
bind: fix py3.9+ deprecation of collections members
...
This fix is part of a larger error handling cleanup.
Py3 generates deprecation warnings of access to containers.Iterator (etc) and states they will break in py3.9. Commit prefers to access members via collections.abs if py3, with a fallback for older py2 location.
Refs go-python/gopy #254
2021-04-05 07:51:26 +12:00
Justin Israel
8ab2cac131
main,bind,_examples: use absolute package imports and make configurable
...
This CL fixes an issue with the way python import statements are generated using an realtive current directory approach that is no longer compatible with python3. The default behavior has been updated to default to a dot-relative absolute package import for "go" and compiled extension, and a configuration option has been exposed from the CLI flags down to the bind package.
A refactor of configuration options was added to avoid further expanding the number of arguments being passed through the system.
Fixes go-python/gopy#239
2021-03-17 22:02:07 +01:00
Randall C. O'Reilly
f802d38242
support subslicing of slices that returns the new Go slice -- was just returning a Python list from elements -- Go-based code then broke with that.
2020-09-11 05:12:53 -07:00
Randall C. O'Reilly
7c8a930907
support pass-through of nil value for slices and maps -- otherwise causes immediate error in generated boilerplate for nil values passed for these. also fix gopy: comment parsing.
2020-09-11 03:00:49 -07:00
Randall C. O'Reilly
1ae2f24440
for slices with non-pointer struct element types, need to return pointer to element so that elements can be modified -- no other way to do this python-side, and generated code assumes pointer receivers
2020-09-09 12:53:25 -07:00
Randall C. O'Reilly
87be7f7b22
bind: add no-warn flag; use underlying type for Named types for struct fields; use overall package name for DecRef etc.
...
Fixes #219
Fixes #220
Fixes #221
2020-03-26 08:30:42 +01:00
Cosmos Nicolaou
35472c0b14
gopy,gopyh,bind: allow for deletion of handles from the map in gopyh
...
- add support for deleting gopyh handles
- add support for checking arguments' type
Fixes #217 .
2020-02-18 22:59:10 +01:00
Sebastien Binet
7e6560ef62
bind: slice elem method auto-wraps the handle, also maps
...
* fixes issue #191 (slice elem method auto-wraps the handle, including extra tests in slices), and fixes py wrapper imports to include everything referenced.
* also wrap handles for map __getitem__
* also rm gopy exe
* update after previewing PR: remove gopy.gide, don't print extra py imports, undo one usage change.
* one more cmd-exe fix
2019-09-30 15:32:05 +02:00
Randall C. O'Reilly
4590bed3b4
add support for 1 return value of a basic type in callbacks: could support other types too with extra testing. also support for optional goRun arg which calls with "go" to run in a different goroutine.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
9e491ab3da
most of PR review comments addressed -- few more to tackle tmrw. haven't changed import paths yet b/c still working out of my dir -- will do that as a last step.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
e381500a36
verified building on py2 and most tests work except for a few minor diffs in output -- calling it good enough for now.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
8d98f0953a
all tests now passing except maps.. also need to test py2
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
7d8693d293
copy function for slices, and general fixes for gi, emergent, both of which are working well
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
1787e368e5
put all externals in go.py module for efficiency; added slice, map methods; most of GoGi now working.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
782d3b74c8
more fixes to exclude various things -- excluding python keywords for example. gi now loads and tries to run - might work on linux, but mac requires main thread for loop.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
d8e2df870b
nearly working on gi -- many more edge cases etc fixed -- needs go imports pass..
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
c4787d0cb8
added maps, arrays, and fixed some handle issues. only callback methods missing now!
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
ae71a5b83f
global "go" package with standard Slice types and the go.GoClass and go.nil. all working for emergent/leabra python script.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
cf18fcbf00
major reorg to support multi-packages in one .so all working -- emergent mostly working.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
42a57a9826
major cleanup: id is now always used as identifier -- replaces pyname -- computed simply. everything always scoped by pkg name in prep for integrated multi-package output.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
60a01ab038
after much experimentation, realized no way around limits of var handle registry being diff for each .so compiled library: need to now make mega-libraries.
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
d8e3ff78f9
added pkg command, does full recursive generate for entire package -- figured out how to navigate python packages finally..
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
849847c8d4
major progress -- handling most things in emer now except emer itself..
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
24e505f408
basic mechanics of multi-package working -- need to be able to import multiple packages easily in python -- look into install etc
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
f8ffa3eefa
slices all working..
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
5aa404702f
more progress on slices, basic named types
2019-08-24 10:31:16 +02:00
Randall C. O'Reilly
89231ef2da
start on slices; use GoHandle and CGoHandle types for all handles -- and now can switch to int64 instead of string keys as py wrapper makes string less important.
2019-08-24 10:31:16 +02:00