cpython 3.3.0 → 3.3.1
raw patch · 5 files changed
+41/−11 lines, 5 filesdep ~text
Dependency ranges changed: text
Files
- cpython.cabal +8/−7
- lib/CPython/Protocols/Number.chs +6/−1
- lib/CPython/Protocols/Object.chs +1/−2
- lib/CPython/Protocols/Object/Enums.chs +20/−0
- lib/CPython/Types/Set.chs +6/−1
cpython.cabal view
@@ -1,5 +1,5 @@ name: cpython-version: 3.3.0+version: 3.3.1 license: GPL-3 license-file: license.txt author: John Millikin <jmillikin@gmail.com>@@ -19,13 +19,13 @@ cbits/hscpython-shim.h source-repository head- type: bazaar- location: https://john-millikin.com/branches/haskell-cpython/3.3/+ type: git+ location: https://john-millikin.com/code/haskell-cpython/ source-repository this- type: bazaar- location: https://john-millikin.com/branches/haskell-cpython/3.3/- tag: haskell-cpython_3.3.0+ type: git+ location: https://john-millikin.com/code/haskell-cpython/+ tag: haskell-cpython_3.3.1 library ghc-options: -Wall -O2 -fno-warn-orphans@@ -35,7 +35,7 @@ build-depends: base >= 4.0 && < 5.0 , bytestring >= 0.9- , text >= 0.1 && < 0.12+ , text build-tools: c2hs >= 0.15@@ -69,6 +69,7 @@ CPython.Protocols.Mapping CPython.Protocols.Number CPython.Protocols.Object+ CPython.Protocols.Object.Enums CPython.Protocols.Sequence CPython.Constants CPython.Reflection
lib/CPython/Protocols/Number.chs view
@@ -109,7 +109,12 @@ then Just $ unsafeCastToNumber obj else Nothing -{# fun PyNumber_Add as add+add :: (Number a, Number b) => a -> b -> IO SomeNumber+add = c_add++-- c2hs won't accept functions named "add" any more, so have it generate+-- c_add and then wrap that manually.+{# fun PyNumber_Add as c_add `(Number a, Number b)' => { withObject* `a' , withObject* `b'
lib/CPython/Protocols/Object.chs view
@@ -63,6 +63,7 @@ import System.IO (Handle, hPutStrLn) import CPython.Internal hiding (toBool)+import CPython.Protocols.Object.Enums import qualified CPython.Types.Bytes as B import qualified CPython.Types.Dictionary as D import qualified CPython.Types.Tuple as Tuple@@ -242,8 +243,6 @@ data Comparison = LT | LE | EQ | NE | GT | GE deriving (Show)--{# enum HSCPythonComparisonEnum {} #} comparisonToInt :: Comparison -> CInt comparisonToInt = fromIntegral . fromEnum . enum where
+ lib/CPython/Protocols/Object/Enums.chs view
@@ -0,0 +1,20 @@+-- Copyright (C) 2009 John Millikin <jmillikin@gmail.com>+--+-- This program is free software: you can redistribute it and/or modify+-- it under the terms of the GNU General Public License as published by+-- the Free Software Foundation, either version 3 of the License, or+-- any later version.+--+-- This program is distributed in the hope that it will be useful,+-- but WITHOUT ANY WARRANTY; without even the implied warranty of+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+-- GNU General Public License for more details.+--+-- You should have received a copy of the GNU General Public License+-- along with this program. If not, see <http://www.gnu.org/licenses/>.++module CPython.Protocols.Object.Enums where++#include <hscpython-shim.h>++{# enum HSCPythonComparisonEnum {} #}
lib/CPython/Types/Set.chs view
@@ -119,7 +119,12 @@ -- brand new 'FrozenSet's before they are exposed to other code). Throws a -- @TypeError@ if the key is unhashable. Throws a @MemoryError@ if there is -- no room to grow.-{# fun PySet_Add as add+add :: (AnySet set, Object key) => set -> key -> IO ()+add = c_add++-- c2hs won't accept functions named "add" any more, so have it generate+-- c_add and then wrap that manually.+{# fun PySet_Add as c_add `(AnySet set, Object key)' => { withObject* `set' , withObject* `key'