From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Sverre Rabbelier <srabbelier@gmail.com>,
Johan Herland <johan@herland.net>,
git@vger.kernel.org
Subject: Re: [PATCH] Makefile: Remove usage of deprecated Python "has_key" method
Date: Sun, 28 Mar 2010 14:54:43 -0700 [thread overview]
Message-ID: <20100328215442.GA31195@gmail.com> (raw)
In-Reply-To: <7vy6hc4d0h.fsf@alter.siamese.dyndns.org>
On Sun, Mar 28, 2010 at 09:38:54AM -0700, Junio C Hamano wrote:
> David Aguilar <davvid@gmail.com> writes:
>
> > "has_key" is a deprecated dictionary method in Python 2.6+.
> > Simplify the sys.path manipulation for installed scripts by
> > passing a default value to os.getenv().
>
> It looks like the old code was replacing sys.path[0] but you are
> prepending this. Doesn't that change also make a difference?
The original code replaced sys.path[0] which is ''
(aka the current directory). It's a little odd to
rely on the 0th element being something that is safe
to remove.
By prepending the path we have the same intended effect without
having to know that the 0th element is something that is
safe to remove.
Does removing '' break relative imports? (It might...)
Due to the portability concerns with relative imports the
recommendation is to always use absolute imports. Thus, this
shouldn't hurt us in practice if we stick to absolute imports,
but I figured I'd mention it as another reason why prepending
might be preferred over replacing.
--
David
next prev parent reply other threads:[~2010-03-28 21:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-28 0:45 [PATCH] Makefile: Remove usage of deprecated Python "has_key" method David Aguilar
2010-03-28 16:38 ` Junio C Hamano
2010-03-28 21:54 ` David Aguilar [this message]
2010-03-29 0:23 ` Tay Ray Chuan
2010-03-29 4:08 ` Junio C Hamano
2010-03-29 2:16 ` Johan Herland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100328215442.GA31195@gmail.com \
--to=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johan@herland.net \
--cc=srabbelier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).