Commits on Mar 25, 2012
  1. Fix gsp->closure setup in newProperty

    We were correctly only setting gsp->get and gsp->set based on the
    arguments passed in - but we were putting NULL pointers into
    PyCapsules which isn't allowed.  We should only be creating the
    PyCapsule if we have setting the corresponding method.
    committed Mar 25, 2012
  2. Go classes need to be allocated in Go

    Because Go is a GC language, we need to allocate the memory that we
    use for classes implemented in Go in a way that makes that memory
    visible to the Go Garbage Collector.  If we don't do this then Go may
    decide that it can free some memory that we are actually still using.
    This problem tends not to show up in simple tests, as they simply
    don't use enough memory for the Go GC to kick in.  Which is why I
    hadn't noticed this until recently.
    Unfortunately, neither Go nor Python make it particularly easy to play
    around with memory allocation and GC tracking.  So the new memory.go
    is rather icky.  Not only having to replicate some Python code, but
    also trick both the Python and Go GC code ... :(
    committed Mar 25, 2012
  3. Go doesn't use Makefiles anymore ...

    committed Mar 25, 2012
Commits on Mar 5, 2012
  1. Don't enable Python signal handling by default in InitAndLock

    With embedded Python it's more likely that signals should be handled
    by the Go code, rather than by the Python code.  So only we want to
    only initialise the Python signal handling if explictly told to do so.
    committed Mar 5, 2012
Commits on Feb 22, 2012
  1. examples/shell: Fix build

    The example was using the old method for creating a TypeError ...
    committed Feb 22, 2012
  2. Update to weekly.2012-02-14

    unsafe.Typeof and unsafe.Unreflect have been removed, so we need to
    replace them with reflect based functionality.
    committed Feb 22, 2012
Commits on Dec 25, 2011
  1. First stab at implementing the Number Protocol

    Most of the functions are implemented (but not all).  Still not 100%
    sure if this is the correct design - but I can't think of a better one
    at the moment.
    committed Dec 25, 2011
Commits on Dec 24, 2011
  1. Add some more docstrings

    committed Dec 24, 2011
  2. Document generated exception functions

    The recently added generated functions should also have generated
    documentation too.
    committed Dec 24, 2011
Commits on Dec 23, 2011
  1. Remove old debug print statement

    committed Dec 23, 2011
  2. Pass proper errors to Python

    In places where code had to raise an exception in Python we were using
    fmt.Errorf to create an error that we turned into a generic exception.
    This isn't appropriate - and we now have a way to do things
    differently.  So change all the uses of Errorf to create an exception
    for Python to create specific types of exception.  Also fix some
    places where we using Printf instead of raise an exception at all.
    committed Dec 23, 2011
  3. Pipe through gofmt

    Since gofmt can process inline, we can use it to make sure that the
    output of is compliant with the latest go coding rules.
    committed Dec 23, 2011
  4. Remove special cases functions for some exceptions

    Dating from before the current exception handling approach was
    implemented there were some functions for creating the types of
    exception I had found a need for.
    These special functions are now removed in favour of some standardised
    functions that are made available for all exceptions.
    committed Dec 23, 2011
  5. Add Matches and Normalize methods to Error type

    This are wrappers for PyErr_GivenExceptionMatches and
    committed Dec 23, 2011
  6. Add recursive call functions

    Add wrappers for Py_EnterRecursiveCall and Py_LeaveRecursiveCall, so
    that Go code can implement recursive code that respects the recursion
    committed Dec 23, 2011
Commits on Dec 14, 2011
  1. Update to build with weekly.2011-12-06

    These changes are basically part of the Go 1 reorg.  Examples
    including renaming types/packages, e.g.:
      os.Error -> error
      exec -> os/exec
    committed Dec 14, 2011
Commits on Oct 25, 2011
  1. Fix example.go

    committed Oct 25, 2011
Commits on Sep 25, 2011
  1. Expose exception kind and value to Go code

    It is possible that Go code may want access to the kind and value
    stored in an Error object.  There is no reason to keep them private,
    so expose them.  This means that they need to be stored as Objects
    instead of *C.PyObject.
    committed Sep 25, 2011
  2. More work on sorting out the exception handling

    This brings us closer to the endgame.  This enables Go code to create
    an exception of any kind.  Containing any value, or values.
    committed Sep 25, 2011
  3. Fix silly copy/paste error

    committed Sep 25, 2011
Commits on Sep 24, 2011
  1. Improve handling of Exceptions

    Still not as nice as I would like, but this is closer.
    Unfortunately, Python doesn't provide a way to get the message that
    would be displayed to the user as a string - it can only be printed to
    stderr.  So, we have to provide our own mechanism constructed from the
    primatives that _are_ available.  This makes the String method a
    little unpleasant.
    committed Sep 25, 2011
Commits on Sep 19, 2011
  1. gofmt

    committed Sep 19, 2011
Commits on Sep 15, 2011
  1. Add missing class methods

    Implement the commented out methods from the context structure.
    committed Sep 15, 2011
Commits on Aug 30, 2011
  1. Improve InitAndLock

    The InitAndLock function is supposed to be the safe way to initialize
    Python.  However, we need to lock the current goroutine to the current
    thread whilst we initialize Python - as the interpreter uses
    per-thread state, and we want that state to remain the same until we
    can release the GIL ready for any code to grab the GIL and make its
    own thread state current.  Once this is done, then we can create and
    lock a new Lock.
    committed Aug 30, 2011
Commits on Aug 25, 2011
  1. Add some more documentation

    committed Aug 25, 2011
  2. Don't expose internals

    The C type member of the Code type is supposed to be private.
    committed Aug 25, 2011
  3. Add Function Type

    This is a representation of a Python function object.  This is the
    object that gets created by the def statement.
    committed Aug 25, 2011
Commits on Aug 24, 2011
  1. Add Set and FrozenSet types

    These types represent the Python set and frozenset types respectively.
    committed Aug 24, 2011
  2. Add Complex type

    This is a representation of the Python complex type.
    committed Aug 24, 2011
Commits on Aug 18, 2011
  1. libffi supports pkg-config

    Since cgo also supports pkg-config we can use that to automatically
    pick up the correct settings.
    committed Aug 18, 2011
  2. Add note that need Python 2.7

    committed Aug 18, 2011
Commits on Aug 17, 2011
  1. Add a second, more useful, example

    The new example is a very simple shell.  This shell is written in Go,
    but allows commands to be implemented in Python - and gives them
    access to tokenisation and run commands via a sh module.
    This demonstrates calling into Python, and extending Python with Go
    modules.  It doesn't include creating a new type in Go though.
    committed Aug 17, 2011
  2. Add convience function for Init when using threads

    There is an interesting issue with using Python from multiple
    goroutines.  Since Go multiplexes goroutines onto threads, we don't
    know which thread we are running on.  The Lock type is supposed to
    sort all this out for us - but it does require that Python be
    initialised in the correct way to work reliably.  Add a convienience
    function that does the initialisation and thread setup in a way that
    leaves things in a state where Locks work as expected.
    committed Aug 17, 2011