Re: [Python-Dev] Request for developer privileges.
Neal Norwitz schrieb: > Hi Lars. > > Thanks for all your work on tarfile! > > Please send your ssh2 key to pydotorg at python.org as an attachment. > One of us will add your key. Hopefully I can remember how to do it. > Here's some other info: http://www.python.org/dev/faq/#subversion-svn > > I can't add you to SF to be assigned bugs since I'm not an admin. So > hopefully one of the admins can either add me as an admin or you as a > developer. Okay, I added both you as a project admin and Lars as a developer and gave him tracker permissions (hopefully). Georg ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] classes and cell variables question
tomer filiba wrote:
> to my understanding of the object model, the code of snippet 1
> and snippet 2 should be equivalent. a class is just a "special function"
> that returns its locals automatically and passes them to the metaclass
> constructor:
PEP 227 (Statically Nested Scopes) covers this in detail (and it echoes
Guido's earlier message - the lexical scoping skips class statements because
class attributes are intended to be accessed via attribute reference on the
class or instance, not as a bare name).
You'll probably find the resulting behaviour less surprising if you think of
class creation in terms of the exec statement rather than as involving any
kind of function definition:
d = dict()
exec in globals(), d
mcl = _determine_metaclass(d, ) # Not magic, but close ;)
cls = mcl(, , d)
Class bodies actually have more in common with module level code than they do
with function bodies (e.g. see how far you get trying to pass a function's
co_code object to the exec statement - it breaks for reasons somewhat related
to what we're discussing here).
To go back to your original example, the second snippet should actually look
more like this:
--- snippet 2a ---
body = """
x = 5
def g(self):
print "g", x
"""
d = dict()
exec body in globals(), d
barcls = type("barcls", (object,), d)
--
.>>> barcls().g()
g
Traceback (most recent call last):
File "", line 1, in
File "", line 4, in g
NameError: global name 'x' is not defined
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://www.boredomandlaziness.org
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py
On Thu, Dec 21, 2006 at 02:14:55AM -0500, Fred L. Drake, Jr. wrote: > I (only vaguely) recall Guido telling people that that's how it's documented, > and that's what they should use. Don't know if he still feels that way; if > he's recanted the obscure path, we can fix both the calls and the > documentation. I'd lend a hand! The constants were added in 2.5. I've gone ahead and made the documentation change to trunk and 25-maint, because why were the constants added if they weren't intended to be used? While looking at the code, I noticed a minor potential bug. Python defines SEEK_SET and friends to be 0,1,2 and then os.lseek() maps them to SEEK_SET, SEEK_CUR, SEEK_END. file.seek() does *not* do this; it just passes the 0,1,2 through to the stdio fseek(), and therefore would be broken if there's some weird platform where 0,1,2 aren't the correct values. This doesn't seem worth fixing, given that no one has ever run into it, and might be an argument for removing the conversion from os.lseek(); clearly it isn't needed. --amk ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [Python-checkins] r53110 - python/trunk/Lib/mailbox.py
A.M. Kuchling schrieb: > The constants were added in 2.5. I've gone ahead and made the > documentation change to trunk and 25-maint, because why were the > constants added if they weren't intended to be used? See #711830. They were added for compatibility (with earlier Python releases) primarily. Some people believe in these constants, so just let them have them. Python (the API) doesn't really rely on them, but instead guarantees that the numeric values are always the same across platforms. Now it seem that introducing them has the unfortunate side effect that people think they *have* to use them, and that doing so gives better code... Regards, Martin ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Weekly Python Patch/Bug Summary
Patch / Bug Summary ___ Patches : 420 open ( +6) / 3510 closed (+12) / 3930 total (+18) Bugs: 944 open ( -5) / 6391 closed (+15) / 7335 total (+10) RFE : 249 open ( +2) / 245 closed ( +0) / 494 total ( +2) New / Reopened Patches __ cp720 encoding map (2006-12-16) http://python.org/sf/1616979 opened by Alexander Belchenko urllib HTTPS Basic authentication fix (2006-12-17) CLOSED http://python.org/sf/1617413 opened by Dug Song The ability to keep configuration files intact (2006-12-17) CLOSED http://python.org/sf/1617496 opened by Roman Kurakin extended slicing for bytes objects (2006-12-18) CLOSED http://python.org/sf/1617678 opened by Thomas Wouters slice-object support for sre_parse.SubPattern (2006-12-18) CLOSED http://python.org/sf/1617680 opened by Thomas Wouters specialcase simple sliceobj in tuple/str/unicode (2006-12-18) http://python.org/sf/1617682 opened by Thomas Wouters specialcase simple sliceobj in list (and bugfixes) (2006-12-18) http://python.org/sf/1617687 opened by Thomas Wouters Extended slicing for UserString (2006-12-18) http://python.org/sf/1617691 opened by Thomas Wouters Extended slicing for array objects (2006-12-18) http://python.org/sf/1617698 opened by Thomas Wouters slice-object support for ctypes Pointer/Array (2006-12-18) http://python.org/sf/1617699 opened by Thomas Wouters slice-object support for mmap (2006-12-18) http://python.org/sf/1617700 opened by Thomas Wouters extended slicing for structseq (2006-12-18) http://python.org/sf/1617701 opened by Thomas Wouters extended slicing for buffer objects (2006-12-18) http://python.org/sf/1617702 opened by Thomas Wouters add None values in SimpleXMLRPCServer (2006-12-19) http://python.org/sf/1618485 opened by Maximiliano Curia sys.intern() 2to3 fixer (2006-12-19) CLOSED http://python.org/sf/1619049 opened by Georg Brandl fix urllib to raise IOError correctly (2006-12-20) CLOSED http://python.org/sf/1619247 opened by Dug Song Bug fixes for int unification branch (2006-12-20) http://python.org/sf/1619846 opened by Adam Olsen Improve platform.py usability on Windows (2006-12-21) http://python.org/sf/1620174 opened by Luke Dunstan Patches Closed __ urllib HTTPS Basic authentication fix (2006-12-17) http://python.org/sf/1617413 closed by akuchling The ability to keep configuration files intact (2006-12-17) http://python.org/sf/1617496 closed by loewis extended slicing for bytes objects (2006-12-18) http://python.org/sf/1617678 closed by twouters slice-object support for sre_parse.SubPattern (2006-12-18) http://python.org/sf/1617680 closed by twouters BZ2File.seek() fails for large files (2006-12-14) http://python.org/sf/1615868 closed by akuchling 1572210 doc patch (2006-11-21) http://python.org/sf/1600491 closed by akuchling cookielib: lock acquire/release try..finally protected (2006-10-30) http://python.org/sf/1587139 closed by akuchling sys.intern() (2006-11-23) http://python.org/sf/1601678 closed by gbrandl sys.intern() 2to3 fixer (2006-12-19) http://python.org/sf/1619049 closed by gbrandl tarfile.py fix for #1471427 and updates (2006-05-09) http://python.org/sf/1484695 closed by gbrandl encoding directive -- more examples (2006-12-11) http://python.org/sf/1613352 closed by gbrandl fix urllib to raise IOError correctly (2006-12-20) http://python.org/sf/1619247 closed by gbrandl New / Reopened Bugs ___ Wrong pathname value in logging output (2006-12-15) http://python.org/sf/1616422 reopened by simleo Wrong pathname value in logging output (2006-12-15) http://python.org/sf/1616422 reopened by simleo Wrong pathname value in logging output (2006-12-15) http://python.org/sf/1616422 opened by Tekkaman Vague description of generator close() method (2006-12-15) CLOSED http://python.org/sf/1616726 opened by Lenard Lindstrom Instance methods compare equal when their self's are equal (2006-12-16) http://python.org/sf/1617161 opened by Frank Niessink test_logging hangs on cygwin (2006-04-06) http://python.org/sf/1465643 reopened by tebeka missing word in "sqlite3-Module-Contents"-documentation? (2006-12-18) CLOSED http://python.org/sf/1618083 opened by lgvienna HMAC can get a 6x performance increase easily (2006-12-18) CLOSED http://python.org/sf/1618455 opened by Ben Maurer bisect on presorted list (2006-12-19) http://python.org/sf/1619060 opened by Jeffrey C. Jacobs 64-bit Universal Binary build broken (2006-12-19) http://python.org/sf/1619130 opened by Thomas Treadway format error in 2.5 ref.pdf in section 5.3.4 Calls (2006-12-20) http://python.org/sf/1619641 opened by cwm
