Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: srinivas devaki Newsgroups: comp.lang.python Subject: Re: Heap Implementation Date: Mon, 8 Feb 2016 08:45:51 +0530 Lines: 22 Message-ID: References: <56AD3D83.2050308@mail.de> <7C522D08-9D73-48D2-A71D-F1D1D34C02A5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de q9YsBAoae/cd0gPl1H2Yywye/wP0uGhwkQdxCiCc4d8w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'dict': 0.09; 'subclass': 0.09; '+91': 0.15; '2016': 0.16; '7:07': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'side.': 0.16; 'wrote:': 0.16; 'library,': 0.18; '>': 0.18; 'email addr:gmail.com>': 0.18; 'library': 0.20; 'student': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; 'junior': 0.22; 'am,': 0.23; 'feb': 0.23; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; 'handling': 0.27; 'message-id:@mail.gmail.com': 0.27; 'idea': 0.28; 'directly,': 0.29; 'fast.': 0.29; 'another': 0.32; 'useful': 0.33; 'handle': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'library.': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'indian': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'client': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'easily': 0.39; 'well.': 0.40; 'still': 0.40; 'your': 0.60; 'school': 0.62; 'introduce': 0.79; '(3rd': 0.84; 'client-side': 0.84; 'dict,': 0.84; 'ph:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6d5BOXOnbFkCjaGajMLrrrKsvPBxKKymSmSUgUy1+tQ=; b=HUEZBvymCGHlalto6dFFOCC2pqhEwLicgcqTCzom4avVxtAYan9tyOi9K9e+x6vJ6c RnqPOvwlWou3/Jvl+H0Iunp6+TPS4PnqBJYhNZihB++ZKePVWA3T1L9V9P5wsGLr5NNd yHIEMl8t+iG3brI2WMIaYbHBHiRZ+U7qbkUhj+tt90XKkQwI45fBQ6XlZOYgYcOB5rod sxPk+6rg6qSeJY33AtYezpoKSJUImRFt7uyJhwJsgBpvkUiQdAa4aBGFXh43NW1Ap54y HLTHsplYMw6BuMtDy0e0v5xuP9vfCQGNbAiDorK6WKoi83AkjI5AZTInvbH/fX2HxJgI 1QsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=6d5BOXOnbFkCjaGajMLrrrKsvPBxKKymSmSUgUy1+tQ=; b=mqlg8k2CbLPZtYj+jQMG70I6kz/hGXLSChGlbbpdawHkcopLTX+rhVdlF23BvpvHEY l522j+QT0OqXpH7gYWkIzV2d7Dm3QPv0xQaErKMEqFgR7bfWHMqVzdMkMnwxW7jLyRgV oU34YO7AH/RKl86nvYjT3MKlBpy6CcnbmWHiwqpbLfyqgd8IUl1VMYTS2u9heKRwXgbe mZwXlZ5zGR00pCRfiSeNbRLllvomubJHA/v//hqqBKDn0g27TC8SOl7Tmqjq+8rpB1G4 VwEWtFaxLSfZlBtsggPy7pugRPJ7vtIBh59sScN0+Snary7JIp/H9PnnlsdnOty6u7ib kSCw== X-Gm-Message-State: AG10YOQaQSTiJi61x+lA/0dC4D9g4ac0bTwsuH6exBIRkyEmnNWWw85zSLNweJmexu1PbGPZqzW2bYIb+77R1g== X-Received: by 10.50.138.72 with SMTP id qo8mr26482245igb.81.1454901352389; Sun, 07 Feb 2016 19:15:52 -0800 (PST) In-Reply-To: <7C522D08-9D73-48D2-A71D-F1D1D34C02A5@gmail.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.21rc2 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102646 On Feb 8, 2016 7:07 AM, "Cem Karan" wrote: > > > > I know that there are methods of handling this from the client-side (tuples with unique counters come to mind), but if your library can handle it directly, then that could be useful to others as well. yeah it is a good idea to do at client side. but if it should be introduced as feature into the library, instead of tuples, we should just piggyback a single counter it to the self._indexes dict, or better make another self._counts dict which will be light and fast. and if you think again with this method you can easily subclass with just using self._counts dict in your subclass. but still I think it is good to introduce it as a feature in the library. Regards Srinivas Devaki Junior (3rd yr) student at Indian School of Mines,(IIT Dhanbad) Computer Science and Engineering Department ph: +91 9491 383 249 telegram_id: @eightnoteight