Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.023 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.05; 'suggestions,': 0.07; 'python': 0.08; 'subject:library': 0.09; 'method.': 0.15; 'python?': 0.15; 'from:addr:alec.taylor6': 0.16; 'from:name:alec taylor': 0.16; 'pdf:': 0.16; 'url:cosc': 0.16; 'wrap': 0.18; 'seems': 0.20; 'received:209.85.210.174': 0.21; 'received:mail-iy0-f174.google.com': 0.21; 'subject:data': 0.25; 'work,': 0.28; 'described': 0.28; 'message-id:@mail.gmail.com': 0.29; 'url:)': 0.29; 'thanks': 0.32; 'test': 0.34; 'calling': 0.34; 'to:addr:python-list': 0.35; 'class.': 0.37; 'url:ac': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'subject:from': 0.39; 'recommended': 0.39; 'received:209': 0.39; 'might': 0.40; 'to:addr:python.org': 0.40; 'taylor': 0.67; 'url:nz': 0.67; '2-3': 0.73; 'url:c': 0.74; 'url:research': 0.91; 'available:': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ju/3dc/zJYScLNrH2if9OUQhhH5c+PHQ0H04FGUZEk0=; b=Jzw4RsMLtA4fV7b0OTNjS4Gd+1Gb8HCB/CXt1m/zZIYFwRwoIQIhPrJcaFGzYUS/Et QbFS3DGjMj2wGcWitfEZCIBDSspBNQGPcz7MGXLd+ZVY/TAIZmP+OiTpT/dhLI6/PY/q qbnG3mLVjdFNyq7vIr+CGwLWZSHjIegr07invNGnkTD00Z6eW1RfELaaVJ0BUCNl9RQy yHYTh7Q1Bf874+NwJbFoQHS1irFaJX3+sJ/4DCvhv0nI/DWpaMcpq+e5I1snDNh6RYf8 k4SJzWuCTmYkZ1Vn9KihGv+n/beGYWd1mC+J+InDUzoc7hM9UL+BCkKGyeSbuUXwGCRJ v/2w== MIME-Version: 1.0 Date: Thu, 8 Mar 2012 01:25:44 +1100 Subject: Porting the 2-3 heap data-structure library from C to Python From: Alec Taylor To: "comp.lang.python" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1331130346 news.xs4all.nl 6859 [2001:888:2000:d::a6]:33275 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21318 I am planning to port the 2-3 heap data-structure as described by Professor Tadao Takaoka in Theory of 2-3 Heaps published in 1999 and available in PDF: http://www.cosc.canterbury.ac.nz/tad.takaoka/2-3heaps.pdf The source-code used has been made available: http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.h http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.c I plan on wrapping it in a class. This tutorial I used to just test out calling C within Python (http://richizo.wordpress.com/2009/01/25/calling-c-functions-inside-python/) and it seems to work, but this might not be the recommended method. Any best practices for how best to wrap the 2-3 heap data-structure from C to Python? Thanks for all suggestions, Alec Taylor