Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Reason for not allowing import twice but allowing reload() Date: Tue, 1 Mar 2016 14:53:06 -0700 Lines: 20 Message-ID: References: <645cdd46-d4a4-49b3-a0d8-848608d70d73@googlegroups.com> <56d57aa4$0$1586$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de +MTHqHdWpqarRwfEhQ9fFwCOfV96ZvY8HgJXZshsXoyQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:209.85.223': 0.03; 'that?': 0.05; 'imply': 0.07; 'modifying': 0.07; 'subject:()': 0.09; 'python': 0.10; 'subject:not': 0.11; '2016': 0.16; 'downtime': 0.16; 'hits': 0.16; 'modules,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:import': 0.16; 'wrote:': 0.16; '>': 0.18; 'email addr:gmail.com>': 0.18; 'am,': 0.23; 'code,': 0.23; 'code.': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'comfortable': 0.27; 'message-id:@mail.gmail.com': 0.27; 'long.': 0.29; 'restart': 0.29; "i'm": 0.30; 'code': 0.30; 'anyone': 0.32; 'possibly': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'tue,': 0.34; 'running': 0.34; 'received:google.com': 0.35; 'done': 0.35; 'sometimes': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'version': 0.38; 'received:209': 0.38; 'mean': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'skip:u 10': 0.61; 'minutes': 0.64; 'mar': 0.65; 'wanting': 0.66; 'night': 0.67; 'production': 0.67; 'to:name:python': 0.84; 'uptime': 0.84; 'thing,': 0.93; 'insane': 0.95; 'imagine': 0.96 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; bh=pAHBW9nt2Q6gmFvXNvhmCeu1SaKdAG0MYYd/GHRFWBM=; b=CeFLpY3uuL0YzPqBcaiLh4mQDpaMrlcoRLopvm2x6nZenvavw6lHxHrXQthIByJ/AB xFonjxxxUGJwOUMpFIj7VLCs7rM5pKq3b6ekPqb3gvtvAaUekRwriWdxPG3FLt8/ARMr 4Yv7btsLHERxdZDedo6zF796vWWnyPpIr9aW5uCjUEWajcmG3D0xWiEnjpahHFqsQ13M CUTZQmZfhw/yygdJZ5yDnTS3ioSRMwwgJBuYrgTrpThTxBlA+2Au9n2cj1ifkYx2ykNM Oqp8Aelt6O9RasKAcC/ycbuK20gAlUNhnPULzd0m+W542QKJbLfUDhNyff4kl59sTXVP ALFw== 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; bh=pAHBW9nt2Q6gmFvXNvhmCeu1SaKdAG0MYYd/GHRFWBM=; b=OmWmxblBTWFESPX9FGz3SJ+dNQDLVu1zBIdalIQvGCEJ9d7cuVEwRt7LYASZwZAuaQ s/JMeasqTzhk+63cou1Gv9p5bnNGLY6qWZ6UJZVB7dnUwwWVW3f97VTvffJL1pVTjRew vyKK7hXyYQPJA7T09y5IUsQZfnm8AvtCHgDiNy00rsYEXltFmbwFRfgjhTsqdMnOPHP4 gAyt3GpRV3w3MtMqhc43ES6NatYMjYi4wX5SQ/S3H+OoNOWAWxavGPF/9bz8koRi3aM9 nEEhqUyZ5QjKJ7vyCCLKstQ/roUA+F7ULf7BCGWwEqpE5orS8zkAeO0QFEd0obWZITQ0 i4Nw== X-Gm-Message-State: AG10YOTGavfN7xdMOBwXyOtEZu3F+2rZ+HPcjgPlSrCIomZ3LVghimOEuPrQp01/t7w3uZXBrw9uW2nqtYwM/A== X-Received: by 10.107.11.93 with SMTP id v90mr26600035ioi.188.1456869187087; Tue, 01 Mar 2016 13:53:07 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 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:103822 On Mar 1, 2016 4:41 AM, "Chris Angelico" wrote: > > On Tue, Mar 1, 2016 at 10:18 PM, Steven D'Aprano wrote: > > I cannot imagine why you would want to reload() in production code. That > > would imply that your production code is modifying already-imported > > modules, then wanting to import them again. Why would anyone in their right > > mind do that? Possibly because they lost a bet? > > BartC and I have both done this exact thing, though neither of us used > Python for it. It's not so insane as you might think; sometimes you > want to update code, but you don't want to restart a process. Just > because you've never had a process that hits a year of uptime doesn't > mean nobody else does. :) I have a hard time understanding the appeal of super-long uptimes. I'm not even comfortable running a single kernel version that long. What's so awful about 5 minutes of announced downtime in the middle of the night once a month while the system restarts?