Re: [Python-Dev] Can Python implementations reject semantically invalid expressions?

2010-07-02 Thread Greg Ewing
u have to ask, is it really worth performing this optimisation? The overhead of raising and handling the exception is likely to completely swamp that of executing the original code. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] Can Python implementations reject semantically invalid expressions?

2010-07-02 Thread Greg Ewing
Craig Citro wrote: Ok, I'm obviously being silly here, but sure you can: dis.dis("raise TypeError()") If producing different bytecode were considered a reason against performing an optimisation, then no code optimisations would be permissible a

Re: [Python-Dev] Can Python implementations reject semantically invalid expressions?

2010-07-02 Thread Greg Ewing
pt Exception, e: ... Usually this kind of thing is only done in test code or illustrative snippets, but even so, it should work as expected. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] Can Python implementations reject semantically invalid expressions?

2010-07-02 Thread Greg Ewing
ving it refuse to compile would be annoying in that case. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] thoughts on the bytes/string discussion

2010-07-07 Thread Greg Ewing
peculating whether a 1-byte build might be of further advantage in a few specialised cases. No matter how much RAM or processing speed you have, it's always possible to find an application that stresses the limits. -- Greg ___ Python-Dev mailing

Re: [Python-Dev] PEP 3148 ready for pronouncement [ACCEPTED]

2010-07-12 Thread Greg Ewing
ed this too, so perhaps it could be made more prominent. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] [Idle-dev] Removing IDLE from the standard library

2010-07-12 Thread Greg Ewing
el scripts with some extension *other* than .py? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Removing IDLE from the standard library

2010-07-14 Thread Greg Ewing
which can't be done if they're in different tabs of the same window. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev

Re: [Python-Dev] Removing IDLE from the standard library

2010-07-14 Thread Greg Ewing
ow to another. My perceptions may be coloured a bit from using Crimson Editor on Windows, where you only get *one* top-level window that you can use either in tabbed or MDI mode. :-( I do use xemacs on linux, and with the ability to display any buffer in any window at will, it's fine

Re: [Python-Dev] mkdir -p in python

2010-07-18 Thread Greg Ewing
ts parents exist" is very commonly required, e.g. when installing software. It makes sense to have it easily available. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://m

Re: [Python-Dev] mkdir -p in python

2010-07-19 Thread Greg Ewing
Ray Allen wrote: I think both os.mkdir() and os.makedirs() should add a keyword argument to suppress the "OSError: [Errno 17] File exists". This could be seen as violating the "no constant arguments" guideline. Maybe separate function would

Re: [Python-Dev] Python signal processing question

2010-07-19 Thread Greg Ewing
page says this about signal(3) in the ERRORS section: [EINVAL] An attempt is made to ignore or supply a handler for SIGKILL or SIGSTOP. Not sure why it gets reported as a RuntimeError rather than an OSError, though. --

Re: [Python-Dev] mkdir -p in python

2010-07-20 Thread Greg Ewing
ts would always be a constant that chooses between two or more different behaviours, then it would probably be better to have separate functions for each of the behaviours. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] mkdir -p in python

2010-07-20 Thread Greg Ewing
eems suboptimal to require people to use a recipe like this to get the behaviour that is wanted in the overwhelming majority of cases. I don't see what would be so bad about adding a new function for this. Think of it as correcting the mistake of not making makedirs() behave this way from the

Re: [Python-Dev] mkdir -p in python

2010-07-21 Thread Greg Ewing
with on Windows. Am I worrying too much? -- Greg ___ Python-Dev mailing list Python-Dev@python.org 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-dev signal-to-noise processing question

2010-07-21 Thread Greg Ewing
de that special-cases SIGKILL in the implementation of signal(). Although he didn't express the question all that clearly, so it's hard to tell. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyth

Re: [Python-Dev] Python signal processing question

2010-07-22 Thread Greg Ewing
recently? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Set the namespace free!

2010-07-22 Thread Greg Ewing
On 23/07/10 04:24, gregory.smi...@sympatico.ca wrote: I've suggested :name, which doesn't break old code, I'm not so sure about that. Consider foo[a::b] Do you parse that as a 3-element slice, or as a 2-element slice with :b as the second el

Re: [Python-Dev] PEP 380 - return value question and prototype implementation (was Thoughts fresh after EuroPython)

2010-07-25 Thread Greg Ewing
the time, even by Guido himself, and he eventually came around to the view that treating generator returns specially wasn't worth the trouble. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pytho

Re: [Python-Dev] marking os.system() as deprecated in the docs

2010-07-26 Thread Greg Ewing
C library wherever reasonable, its lack would seem a bit odd. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Thoughts fresh after EuroPython

2010-07-27 Thread Greg Ewing
from my Python code. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Readability of hex strings (Was: Use of coding cookie in 3.x stdlib)

2010-07-27 Thread Greg Ewing
aracterish stuff or just raw data. It wouldn't affect the behaviour in any way except that the repr would come out in hex instead of text. Then b"..." and h"..." literals could produce bytes objects with different settings for the raw-data bit. -- Greg ___

Re: [Python-Dev] mkdir -p in python

2010-07-28 Thread Greg Ewing
Hrvoje Niksic wrote: mktree would only create a single "branch", not an entire tree. Maybe mkbranch, then? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] GIL musings (was Re: Thoughts fresh after EuroPython)

2010-07-28 Thread Greg Ewing
;d be upset if I could no longer write games in Python that achieve smooth animation because of unpredictable GC pauses. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-31 Thread Greg Ewing
ke it special, and broke their code, which is within the rules as you just stated them. The rule doesn't say anything about what *kinds* of breakage are allowed, so anything goes, including making it impossible to assign to the name any more. -- Greg __

[Python-Dev] Exception chaining and generator finalisation

2010-07-31 Thread Greg Ewing
gt;> next(gi) 1 >>> gi.close() Traceback (most recent call last): File "", line 3, in g GeneratorExit During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "", line 5, in g ValueErr

Re: [Python-Dev] Exception chaining and generator finalisation

2010-07-31 Thread Greg Ewing
andling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 4, in RuntimeError: Ooops That's a bit different, because the fact that the program was terminated by Ctrl-C could be useful information. -- Greg _

Re: [Python-Dev] Exception chaining and generator finalisation

2010-08-01 Thread Greg Ewing
try: yield 1 finally: raise ValueError("Hovercraft contains eels") except Exception: tb.print_exc() gi = g() next(gi) del gi -- Greg def g(): ... try: yield 1 ... finally: 1/0 ... gi = g() next(gi) 1 del gi Excepti

Re: [Python-Dev] Exception chaining and generator finalisation

2010-08-01 Thread Greg Ewing
Nick Coghlan wrote: A toy example, that isn't obviously broken at first glance, but in fact fails when close() is called: Okay, you've convinced me. I'll consider it to be correct behaviour and update my expected yield-from test results accord

[Python-Dev] Yield-From Implementation Updated for Python 3

2010-08-01 Thread Greg Ewing
ython/yield-from/ -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-08-01 Thread Greg Ewing
out losing the user's preferences from the previous version. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] co_firstlineno on decorated functions

2010-08-03 Thread Greg Ewing
them is good. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Drive suffix

2010-08-04 Thread Greg Ewing
any system that's "just like Windows" except that it uses something other than colons. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/o

Re: [Python-Dev] barry_as_FLUFL

2010-08-05 Thread Greg Ewing
Barry Warsaw wrote: Wait. It's a joke?! Probably, but it's also useful behaviour -- I hope it stays! (Not that I would ever presume to use it in any code inflicted on anyone else, but it's nice to know I have a choice in the privacy of my own computer.) Heil-the

Re: [Python-Dev] [Python-checkins] r83763 - in python/branches/py3k: Doc/library/signal.rst Lib/test/test_signal.py Misc/NEWS Modules/signalmodule.c

2010-08-07 Thread Greg Ewing
re, because it suggests a contiguous range of legal values, which isn't the case. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] mingw support?

2010-08-07 Thread Greg Ewing
in incompatible ways with every release, the result is that extensions for versions of Python older than N years can no longer be compiled with any legally-available free MS compiler. If you're talking about pragmatism, I think this situation causes very pragmat

[Python-Dev] Adding a token

2010-08-07 Thread Greg Ewing
e how this can happen, because pgen seems to use the same tokenizing code as Python itself. Is there anything else I need to do? Does some file need to be manually re-made? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] Adding a token

2010-08-07 Thread Greg Ewing
omatically just from seeing a '?' in the grammar. I just tried an experiment -- I changed the grammar to accept '?' as an alternative to '+', and tried to use the parser module to parse "1?2". It reported a SyntaxError. -- Greg __

Re: [Python-Dev] Adding a token

2010-08-07 Thread Greg Ewing
id indeed not work. Does anyone know if there's a way to tell Apple's linker to use a framework from a specific location and not go looking anywhere else? In the meantime, I think I'll switch to a non-framework build for this project. -- Greg __

[Python-Dev] Bug in 3.1.2 site.py

2010-08-09 Thread Greg Ewing
), s) sys.path.append(s) However, it doesn't always work, because distutils.util.get_platform tries to find a Makefile in the install location, which doesn't exist if the Python you're building has never been installed! -- Greg ___ Python-Dev

Re: [Python-Dev] mingw support?

2010-08-12 Thread Greg Ewing
as, it would be good to have a mingw-based alternative. Otherwise everyone is forced to convert to the Windows religion. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://

[Python-Dev] Oddity in AST for 3-argument slices

2010-08-19 Thread Greg Ewing
>>> ast.dump(t) "Expression(body=Subscript(value=Name(id='x', ctx=Load()), slice=Slice(lower=None, upper=None, step=Name(id='None', ctx=Load())), ctx=Load()))" In other words, x[::] is being parsed as though it had been writte

Re: [Python-Dev] Oddity in AST for 3-argument slices

2010-08-19 Thread Greg Ewing
doesn't seem to significantly simplify the compiler either, because compiler_slice() could just as easily treat it the same way as the other slice arguments and emit an instruction to load None if it's missing. So it's a mystery. Perhaps it made life easier for some earlier ver

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Greg Ewing
its own special method. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-24 Thread Greg Ewing
some people may want. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Greg Ewing
s in order to just return a value! Even with your proposal, you'd still have to use a 'creepy abstraction' every time one of your coroutines calls another. That's why PEP 380 deals with 'more than just return'. -- Greg _

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-27 Thread Greg Ewing
t; extra zero too! But if I add another zero, it begins to slow to a crawl as it uses swap space. ;-) How would a "yield from" version compare? ... there is still a Python frame in existence for each active invocation of the generator, so it would probably us

Re: [Python-Dev] PEP 384 status

2010-08-31 Thread Greg Ewing
ake a FILE* directly in the first place. Maybe PyObject_Print should be deprecated in favour of something that takes a Python I/O object instead. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] PEP 384 status

2010-08-31 Thread Greg Ewing
. For every Python function that allocates something, there's a corresponding function for freeing it, and you do it any other way at your peril. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] PEP 384 status

2010-09-02 Thread Greg Ewing
On 02/09/10 09:04, Nick Coghlan wrote: I think it would be better if everything dealing with FILE* was a macro rather than a function, yes. How would that help? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] Some news from my sandbox project

2010-09-18 Thread Greg Ewing
ou to that would be prevented by making it read-only? Seems to me that the only way you could exploit a writable __builtins__ would be to put a function in there that does something bad. But if you can create or obtain such a function in the first place, you can just call it directly. --

Re: [Python-Dev] Some news from my sandbox project

2010-09-18 Thread Greg Ewing
Robert Collins wrote: __builtins__ is in everyone's global namespace, so if it can be mutated, different python programs running in the same sandbox can affect each other. So give each program its own copy of __builtins__. -- Greg ___ Pytho

Re: [Python-Dev] Some news from my sandbox project

2010-09-18 Thread Greg Ewing
x27;t follow. Trusted functions such as proxy() shouldn't be sharing a __builtins__ dict with sandboxed code. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

Re: [Python-Dev] Some news from my sandbox project

2010-09-19 Thread Greg Ewing
need to be isolated, each one should run in its own sandbox with its own __builtins__ dict. > should I create a new copy of __builtins__ for each frame? No, not for each frame, just for each computation that needs to be isolated. -- Greg ___ P

Re: [Python-Dev] os.path.normcase rationale?

2010-09-24 Thread Greg Ewing
, return it if found. 2) Look for a match ignoring case. If one is found, test it to see if it refers to the same file as the given path, and if so return it. 3) Otherwise, raise an exception. -- Greg ___ Python-Dev mailing list Python-Dev@python.org ht

Re: [Python-Dev] os.path function for “get the re al filename”

2010-09-24 Thread Greg Ewing
ar problem in some ways. It seems to me this whole thing should be hashed out on ‘python-ideas’. Good point -- I've redirected the discussion there. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/list

Re: [Python-Dev] os.path.normcase rationale?

2010-09-24 Thread Greg Ewing
lpath(). -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] os.path.normcase rationale?

2010-09-25 Thread Greg Ewing
e they're guaranteed to return the actual case rather than something that happens to work. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/o

Re: [Python-Dev] [Web-SIG] WSGI is now Python 3-friendly

2010-09-27 Thread Greg Ewing
in a paragraph? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] question/comment about documentation of relative imports

2010-10-05 Thread Greg Ewing
Guido van Rossum wrote: Now it is time to withdraw the anti-recommendation. Or at least re-word them all to make it clear that they're talking about the *old* style of relative import in 2.x. -- Greg ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] Another relative imports question

2010-10-08 Thread Greg Ewing
nable answer is that you should be able to refer to it simply as 'mymodule'. This may require treating it as a bit of a special case, but it would make intuitive sense. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyth

Re: [Python-Dev] Distutils2 scripts

2010-10-11 Thread Greg Ewing
efer some scheme involving 'python -m ...' or some other option to Python itself, rather than a separate executable. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Distutils2 scripts

2010-10-11 Thread Greg Ewing
remember On Windows I think it's easier and more reliable to set things up so that you can invoke a .py file directly as a command. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscri

Re: [Python-Dev] Distutils2 scripts

2010-10-21 Thread Greg Ewing
equire install-time path hacking of the sort that some people are uncomfortable about. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] __setcall__

2010-10-26 Thread Greg Ewing
corresponding special method. If that's the case, the appropriate place for initial discussion would be python-ideas. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Cleaning-up the new unittest API

2010-11-02 Thread Greg Ewing
as sorting that require a total ordering could use __cmp__ and complain if they get an unordered result. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mai

Re: [Python-Dev] Breaking undocumented API

2010-11-10 Thread Greg Ewing
sually come with prefixes to manage C's totally-global namespace. So there's a bit of a double bind there. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Breaking undocumented API

2010-11-11 Thread Greg Ewing
ndant). What about names imported from other modules that are used by the module, but not intended for re-export? How would you prevent them from turning up in help() etc. without using __all__? -- Greg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Breaking undocumented API

2010-11-12 Thread Greg Ewing
-public functions or something private that's accidentally been given a non-underscore name. Greg Ewing wrote: Also it means that help() wouldn't show me documentation for the support functions, which is a bad thing if they really are intended for public use. I don't see why... if you

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Greg Ewing
. The bool type was added for much the same reason -- otherwise we would simply have gotten builtin names False = 0 and True = 1. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: ht

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Greg Ewing
Antoine Pitrou wrote: Well, it's been inherited by C-like languages, no doubt. Like braces and semicolumns :) The idea isn't confined to the C family. Pascal and many of the languages inspired by it also have enumerated types. -- Greg

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Greg Ewing
value assignment, seeing as it's another common pattern. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Greg Ewing
r.red print(c) printing "red" rather than "(255, 0, 0)". -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Greg Ewing
#x27;s only in the C family that you get this bastardised conflation of enumerations with arbitrary named constants... -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.

Re: [Python-Dev] constant/enum type in stdlib

2010-11-23 Thread Greg Ewing
ght be the least worst option. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-23 Thread Greg Ewing
opular and well-reviewed application software. """ Maybe Python should have used UTF-8 as its internal unicode representation. Then people who were foolish enough to assume one character per string item would have their programs break rather soon under only light

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Greg Ewing
On 24/11/10 13:22, James Y Knight wrote: Instead, provide bidirectional iterators which can traverse the string by byte, codepoint, or by grapheme Maybe it would be a good idea to add some iterators like this to Python. (Or has the time machine beaten me there?) -- Greg

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Greg Ewing
er, because it would all be encapsulated in one object. So I don't really see what you're arguing for here. How do *you* think positions in unicode strings should be represented? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://ma

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Greg Ewing
urn appropriate iterators. (Or possibly iterable views, but that would raise the expectation that the views could also be randomly indexed by char or grapheme, which we probably wouldn't want to support.) -- Greg ___ Python-Dev mailing list Python

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Greg Ewing
On 25/11/10 12:38, average wrote: Is immutability a general need that should have general solution? I don't think it really generalizes. Tuples are not just frozen lists, for example -- they have a different internal structure that's more efficient to create and access

Re: [Python-Dev] constant/enum type in stdlib

2010-11-28 Thread Greg Ewing
objects, this means that the size of the tuple must be known when the object is created. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/pytho

Re: [Python-Dev] constant/enum type in stdlib

2010-11-29 Thread Greg Ewing
s as two blocks, and give up some of the performance advantages of the current tuple structure. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/option

Re: [Python-Dev] constant/enum type in stdlib

2010-11-29 Thread Greg Ewing
trying to group them together afterwards. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] python3k : imp.find_module raises SyntaxError

2010-12-01 Thread Greg Ewing
imported from, I also know which file to look in for its definition. If a module can be spread over several files, that feature would be lost. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-10 Thread Greg Ewing
Guido van Rossum wrote: > Then let's allow > > nonlocal x = 12 > > as a shortcut for > > nonlocal x > x = 12 I thought you didn't like that, because in nonlocal x = 12 x = 42 it's not clear whether these are ta

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-10 Thread Greg Ewing
Mike Krell wrote: > If I've followed the discussions correctly, I think the parent scope > would be operative, so I humbly suggest "parent". -1, this is far too commonly used as a variable name. -- Greg ___ Python-Dev ma

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-11 Thread Greg Ewing
Matthew Barnes wrote: > its > meaning in C/C++ (i.e. the symbol is defined outside of the current > scope). It means more than that -- it means defined outside the current *file*. That's much too drastic for what we want. -- Greg ___ Pyth

Re: [Python-Dev] [slighly OT] Native speakers and hurting brains

2006-07-11 Thread Greg Ewing
ither -- at least not so much as to be relegated to a myth! -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] [slighly OT] Native speakers and hurting brains

2006-07-11 Thread Greg Ewing
ot), the decision was made to disallow it. Does that version sound less like a creation myth?-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] [slighly OT] Native speakers and hurting brains

2006-07-11 Thread Greg Ewing
"a plus b". Now, "plus" has a somewhat wider meaning than "sum". It sounds quite in order to say things like "I have a sandwich plus an apple in my lunch box", but it would be odd to say "I have the sum of a sandwich and an apple in my lunch box&q

Re: [Python-Dev] User's complaints

2006-07-13 Thread Greg Ewing
Wolfgang Langner wrote: > @main > def whatever(): > ... This seems like replacing one unpythonic feature with another. (I *still* can't get used to that @ syntax -- it looks like an intruder from Rubyland...) -- Greg ___ Python-De

[Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-13 Thread Greg Ewing
e rest of the args, so the first thing you always do is args[1:]. It's not so bad in C, where it's just as easy to start indexing argv from 1 instead of 0. But it makes no sense in Python, IMO. It would be much more sensible to move it into a

Re: [Python-Dev] User's complaints

2006-07-13 Thread Greg Ewing
Jeroen Ruigrok van der Werven wrote: > - Open classes would be nice. What do you mean by "open classes"? Python classes already seem pretty open to me, by the standards of other languages! -- Greg ___ Python-Dev mailing list Python-D

Re: [Python-Dev] User's complaints

2006-07-13 Thread Greg Ewing
sure you remember, has been highly debated. :-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] User's complaints

2006-07-13 Thread Greg Ewing
C++ likely don't see this as a problem. But since I've come to appreciate the benefits of Python's module system, I don't want to go back to that nightmare. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

Re: [Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-13 Thread Greg Ewing
importless interpreter you suggest wouldn't be unnecessarily crippled). -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-13 Thread Greg Ewing
Guido van Rossum wrote: > I'nm afraid if we > were to split it by functionality we'd have to split it 5-way or so... What about just splitting it into "mutable" and "immutable" parts? That would be a fairly clear division, I think. -- Greg __

Re: [Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-13 Thread Greg Ewing
inode number or > whatever. I don't think that applies to the Python args[] though, since its args[0] isn't the path of the OS-level executable, it's the path of the main Python script. But you could still end up without one, if the main script comes from somewhe

Re: [Python-Dev] Community buildbots (was Re: User's complaints)

2006-07-13 Thread Greg Ewing
s of an impression that stuff is being sprung on the community unawares. > OT1H I think there > will always be people or projects that won't try anything until the > gold release, Well, at least they've had a chance to try it. If they don't take that chance, they don

Re: [Python-Dev] Community buildbots

2006-07-13 Thread Greg Ewing
taclasses. I don't think it would hurt to have it available as a __future__ import as well. There's also the advantage that all of a module's future assumptions could then be documented uniformly in one place, i.e. in a __future__ import at the top. -- Greg _

<    6   7   8   9   10   11   12   13   14   15   >