Re: [Python-Dev] cpython: Minor clean-ups for heapq.

2014-05-27 Thread Michael Urman
On Tue, May 27, 2014 at 4:05 AM, Chris Angelico wrote: > On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka wrote: >> 26.05.14 10:59, raymond.hettinger написав(ла): >>> >>> +result = [(elem, i) for i, elem in zip(range(n), it)] >> >> >> Perhaps it is worth to add simple comment explaining

Re: [Python-Dev] PEP 461 - Adding % and {} formatting to bytes

2014-01-16 Thread Michael Urman
On Thu, Jan 16, 2014 at 11:13 AM, Neil Schemenauer wrote: > A TypeError exception is what we want if the object does not support > bytes formatting. Some possible problems: > > - It could be hard to provide a helpful exception message since it > is generated inside the __format__ method rather

Re: [Python-Dev] PEP 461 - Adding % and {} formatting to bytes

2014-01-16 Thread Michael Urman
On Thu, Jan 16, 2014 at 8:45 AM, Brett Cannon wrote: > Fine, if you're worried about bytes.format() overstepping by implicitly > calling str.encode() on the return value of __format__() then you will need > __bytes__format__() to get equivalent support. Could we just re-use PEP-3101's note (easil

Re: [Python-Dev] [RELEASED] Python 3.4.0b2

2014-01-06 Thread Michael Urman
On Mon, Jan 6, 2014 at 9:43 AM, Guido van Rossum wrote: > Since MSIEXEC.EXE is a legit binary (not coming from our packager) and > Akamai is a legitimate company (MS most likely has an agreement with > them), at this point I would assume that there's something that > MSIEXEC.EXE wants to get from

Re: [Python-Dev] Python 3.4 and Windows XP: just 45 days until EOL

2013-07-12 Thread Michael Urman
On Thu, Jul 11, 2013 at 6:58 PM, Christian Heimes wrote: > For Python 3.4 is going to be a very close call. According to PEP 429 > 3.4.0 final is scheduled for February 22, 2014. The extended support > phase of Windows XP ends merely 45 days later on April 8, 2014. Do we > really have to restrict

Re: [Python-Dev] PEP 435: pickling enums created with the functional API

2013-05-07 Thread Michael Urman
On Tue, May 7, 2013 at 8:34 AM, Eli Bendersky wrote: > According to an earlier discussion, this is works on CPython, PyPy and > Jython, but not on IronPython. The alternative that works everywhere is to > define the Enum like this: > > Color = Enum('the_module.Color', 'red blue green') > > The

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-12 Thread Michael Urman
On Fri, Apr 12, 2013 at 9:30 AM, Barry Warsaw wrote: > On Apr 12, 2013, at 09:03 AM, Michael Urman wrote: > >(For the latter behavior, would adding DupEnum.name2 = DupEnum.name1 after > >the class declaration work today?) > > Yes, but the repr/str of the alias will sh

Re: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

2013-04-12 Thread Michael Urman
Enum.name1 is DupEnum.name2 be True. (For the latter behavior, would adding DupEnum.name2 = DupEnum.name1 after the class declaration work today?) Michael -- Michael Urman ___ 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] an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)

2012-04-06 Thread Michael Urman
r systems where another user has locked the clock. Thus the exception cannot tell you anything more than None tells you. (Of course, if my assumption is wrong, I'm not sure whether my reasoning still applies.) -- Michael Urman ___ Python

Re: [Python-Dev] Playing with a new theme for the docs, iteration 2

2012-03-25 Thread Michael Urman
hen the text next to it reflows to a new length, the bar can become longer or shorter than necessary. On the one hand this makes it hard to get the sidebar content to show at the bottom of the page; on the other, I believe it mitigates potential problems if sidebar content is t

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-23 Thread Michael Urman
On Sun, Oct 23, 2011 at 20:58, Mark Hammond wrote: > On 24/10/2011 12:56 PM, Michael Urman wrote: >> >> On Sun, Oct 23, 2011 at 17:15, Mark Hammond >>  wrote: >>> >>> How about abusing the existing flags for this purpose - eg: >>> >>> %

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-23 Thread Michael Urman
On Sun, Oct 23, 2011 at 17:15, Mark Hammond wrote: > How about abusing the existing flags for this purpose - eg: > > % py -3? > % py -2.7? I would have expected that to launch an interactive python shell of the appropriate version. Does it do something else today? Michael ___

Re: [Python-Dev] Coding guidelines for os.walk filter

2011-08-30 Thread Michael Urman
mented behavior. http://docs.python.org/dev/library/os.html#os.walk shows a similar example: for root, dirs, files in os.walk('python/Lib/email'): # ... dirs.remove('CVS') # don't visit CVS directories -- Michael Urman __

Re: [Python-Dev] PEP 397 (Python launcher for Windows) reference implementation

2011-07-05 Thread Michael Urman
the python 3.3 installer, future releases, and even a standalone installer, and reference count correctly. Again, these can optionally be made available as merge modules for other consumers, but there's likely no need. -- Michael Urman ___ Python-Dev

Re: [Python-Dev] [Python-checkins] cpython: _PyImport_LoadDynamicModule() encodes the module name explicitly to ASCII

2011-05-10 Thread Michael Urman
thon could certainly try to load by ordinal on Windows, and fall back to loading by name. I don't have a clue what the rate of false positives would be. -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/li

Re: [Python-Dev] [Python-checkins] cpython: _PyImport_LoadDynamicModule() encodes the module name explicitly to ASCII

2011-05-09 Thread Michael Urman
On Mon, May 9, 2011 at 23:09, Neil Hodgson wrote: > Michael Urman: > >> I'm not convinced this is correct for this case. GetProcAddress takes >> an "ANSI" string, meaning while it could theoretically use UTF-8, in >> practice I doubt it uses anything outsid

Re: [Python-Dev] [Python-checkins] cpython: _PyImport_LoadDynamicModule() encodes the module name explicitly to ASCII

2011-05-09 Thread Michael Urman
; string, meaning while it could theoretically use UTF-8, in practice I doubt it uses anything outside of ASCII safely. So while the name of the library would be encoded in UTF-16, the name of the function loaded from the library would not be. http://msdn.microsoft.com/en-us/library/ms683212(v=vs.8

Re: [Python-Dev] [PEPs] Support the /usr/bin/python2 symlink upstream

2011-03-08 Thread Michael Urman
ws Installer can process them, it will even keep the highest version of the file in place. -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/op

Re: [Python-Dev] [PEPs] Support the /usr/bin/python2 symlink upstream

2011-03-08 Thread Michael Urman
st 3.x, etc.). If it doesn't have a version, find the latest 2.x or latest any version as above, per the most recent relevant PEP. Open question is what to do if the script clearly requests version 2.6 but only 2.5, 2.7 and 3.2 are installed, or requests 2.x but only 3.x is installed; I cou

Re: [Python-Dev] [PEPs] Support the /usr/bin/python2 symlink upstream

2011-03-06 Thread Michael Urman
Using batch files is a poor idea, IMO, because you have to explicitly call a batch file from another, or the remainder of the caller will not execute. Installing to System32 s also questionable, but if it's just the launchers, it might be okay. From an installer's perspective, it would really help

Re: [Python-Dev] Python merge module

2011-02-03 Thread Michael Urman
On Thu, Feb 3, 2011 at 00:30, "Martin v. Löwis" wrote: > Another challenge with shared location merge modules is upgrades: > the Python installer currently doesn't use stable component IDs; > I think this would cause problems for users of the merge module. > Providing stable component IDs is a cha

Re: [Python-Dev] Python merge module

2011-02-02 Thread Michael Urman
On Wed, Feb 2, 2011 at 15:27, Hoyt, David wrote: >> The Installer COM object is the platform standard mechanism, and that's what >> msilib uses. > > Why maintain a lib when there's (better), free alternatives out there that > are maintained by Microsoft itself? (okay, a group at Microsoft that w

Re: [Python-Dev] email package status in 3.X

2010-06-22 Thread Michael Urman
On Tue, Jun 22, 2010 at 15:32, Terry Reedy wrote: > On 6/22/2010 9:24 AM, Michael Urman wrote: >> These are trivial functions; >> I just don't fully understand why the capability isn't baked in. > > Possible reasons: They are special purpose functions easily

Re: [Python-Dev] email package status in 3.X

2010-06-22 Thread Michael Urman
On Tue, Jun 22, 2010 at 00:28, Stephen J. Turnbull wrote: > Michael Urman writes: > >  > It is somewhat troublesome that there doesn't appear to be an obvious >  > built-in idempotent-when-possible function that gives back the >  > provided bytes/str, > > If

Re: [Python-Dev] email package status in 3.X

2010-06-21 Thread Michael Urman
apparently either a string is not a character buffer, or the docs are incorrect. http://docs.python.org/py3k/library/functions.html?highlight=str#str However it looks like this is consistent with int. >>> int(4, 0) TypeError: int() can't convert non-string with explicit ba

Re: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

2010-05-21 Thread Michael Urman
a() What should C.a(), C().a(), and C().a(1) each yield? Does it change if c(self, k) calls C.a(self)? -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python

Re: [Python-Dev] Fwd: Download Page - AMD64

2010-01-13 Thread Michael Urman
ing about the names shown on MSDN subscriptions for downloading installation media of Windows 7 and Windows Vista. It's pretty clear in that context Microsoft uses x64 to describe this platform of Windows. But again, it's far from clear that this is a term they use for non-developers. --

Re: [Python-Dev] Fwd: Download Page - AMD64

2010-01-13 Thread Michael Urman
thon 2.6.4 installer for Windows (x64). Unfortunately this usage doesn't seem to be reflected in consumer-oriented product pages, so I'm uncertain how clear it is for those downloading Python. -- Michael Urman ___ Python-Dev mailing list Py

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-07 Thread Michael Urman
"surrogatereplace", errors="surrogateescape", errors="binaryreplace", errors="binaryescape". This includes Antoine's proposal (sans hyphen). -- Michael Urman ___ 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] PEP 383 update: utf8b is now the error handler

2009-05-07 Thread Michael Urman
On Thu, May 7, 2009 at 00:43, "Martin v. Löwis" wrote: > Michael Urman wrote: >> On Wed, May 6, 2009 at 15:42, "Martin v. Löwis" wrote: >>> Despite there being also an error handler called "surrogates". >> >> Not that I have to

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-06 Thread Michael Urman
r than UTF-8, no big deal. I could also see something like errors="roundtrip" which explains the intention of the handler rather than the algorithm, but is awkward on encode when it encounters unavailable Unicode characters. -- Michael Urman

Re: [Python-Dev] PEP 383 update: utf8b is now the error handler

2009-05-03 Thread Michael Urman
s over sockets, and "utf8" will be prone to exceptions on the very names we're trying to support right now. Is there an advantage to not providing the the "utf8b" behavior as a registered codec? -- Michael Urman ___ Python

Re: [Python-Dev] a suggestion ... Re: PEP 383 (again)

2009-04-30 Thread Michael Urman
Unicode strings can occur on the Windows filesystem, I don't find their use in PEP 383 to be a flaw. -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-28 Thread Michael Urman
ironmentally aware, but serialization probably will not. Should this PEP make recommendations about how to save filenames in configuration files? -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-25 Thread Michael Urman
opers what new exception might occur where? It would be a shame to have a solid application developed under Windows start raising encoding exceptions on linux. Would the encoding error get mapped to an IOError for all file APIs that do this encoding? -- Michael Urman ___

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-25 Thread Michael Urman
on-escape? Will a new name fully provided by a user on his keyboard (ignoring copy and paste) almost always safely encode? -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] And the winner is...

2009-03-30 Thread Michael Urman
> We're switching to Mercurial (Hg). And two hours later, GNOME announces their migration to git is underway. I'd suspect a series of April Fools jokes, if it weren't two days early. :) -- Michael Urman ___ Python-Dev maili

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-07 Thread Michael Urman
Adam, for sending this only to you the first time] -- Michael Urman ___ 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-3.0, unicode, and os.environ

2008-12-05 Thread Michael Urman
ey're still bytes no matter how much we want them to be characters. This difference, and secondarily the way python 3 tries to sweep it under the rug, seem to be the roots of the problem. -- Michael Urman ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-05 Thread Michael Urman
ere the idea of encoding filenames and environment > variables any other way is seen as crazy, then the Python 3 approach > will work seamlessly. > > In the meantime, raw bytes APIs will provide an alternative for those > that disagree with that philosophy. And until that

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-30 Thread Michael Urman
will map the ANSI bytestring to a Unicode filename via the active code page, and call CreateFileW accordingly. The active code page cannot be set to something as useful as UTF-8, so given any actual code page (1252, 932, etc.) there are Unicode strings that cannot be represented with a bytestrin

Re: [Python-Dev] [Python-3000] [Python-checkins] r62848 - python/trunk/Objects/setobject.c

2008-05-08 Thread Michael Urman
needing modifications if they contain direct svn url references. -- Michael Urman ___ 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] unittest's redundant assertions: asserts vs. failIf/Unlesses

2008-03-19 Thread Michael Urman
asional "misuse")? But I'm not the one offering a patch here, so I'll pipe down now. :) -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mai

Re: [Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses

2008-03-19 Thread Michael Urman
means the change saves nothing, and costs plenty. Note the acronym is OOWTDI, not OONTDI - using a different name does not necessarily make it a different way. -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] trunc()

2008-01-27 Thread Michael Urman
ting integers from other numeric types), would separating parsing from the int (and float) constructors also solve this? Is the aim to "clean up" the following fake example? (Real world uses of map(int, ...) seem almost uniformly related to string parsing.) >>> map(i

Re: [Python-Dev] Syntax suggestion for imports

2008-01-02 Thread Michael Urman
during the lifetime of late 2.x, helps swing me back the other way. -- Michael Urman ___ 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] Registry keys written by x64 installer

2007-07-13 Thread Michael Urman
On 7/13/07, Michael Urman <[EMAIL PROTECTED]> wrote: > That's even easier then, if anything's actually wrong. I'll find some > time this weekend to look at it and report back. Would the one at the > following URL be the correct one to verify? > > http://www.pyth

Re: [Python-Dev] Registry keys written by x64 installer

2007-07-13 Thread Michael Urman
On 7/13/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Michael Urman schrieb: > > Right - it sets the template summary to include Intel64, not x64. > > You might be looking at the wrong version. In Python 2.5, it also > sets it to x64, if the PE machine

Re: [Python-Dev] Registry keys written by x64 installer

2007-07-13 Thread Michael Urman
On 7/13/07, Mark Hammond <[EMAIL PROTECTED]> wrote: > On Friday, 13 July 2007, Michael Urman wrote: > I suspect I'm still missing something here. The title of the page you > referenced before is "Using 64-Bit Windows Installer Packages" - I suspect > that is

Re: [Python-Dev] Registry keys written by x64 installer

2007-07-12 Thread Michael Urman
atching it. I don't have a convenient 64-bit Windows machine around to test any changes, though. -- Michael Urman ___ 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] Registry keys written by x64 installer

2007-07-12 Thread Michael Urman
lt, along with entirely 64-bit components. This wouldn't work for x64 machines, and all components being 64-bit may be incorrect: potentially the 64-bit installer should have some 32-bit components. -- Michael Urman ___ Python-Dev mailing list Py

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-15 Thread Michael Urman
er value judgements reflected in Misc/NEWS, there are no similar APIs with which we can compare behavior and match to increase consistency. Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-Dev@python.org http://m

Re: [Python-Dev] Proposal to revert r54204 (splitext change)

2007-03-14 Thread Michael Urman
ople want to retrieve the file name without the extension, we should add a function to return this basic name. Who would rather see os.path.dropext(path)? Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-De

Re: [Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects

2006-12-07 Thread Michael Urman
ings easier on everyone because there's less to remember, not because it makes us better learners of the skills necessary for programming well. The arguments I saw in the paper only addressed the second point. -- Michael Urman http://www.tortall.net/mu/blog

Re: [Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects

2006-12-07 Thread Michael Urman
eful as indexing. Really I don't use regexps enough in Python to have a position; I was more interested in figuring out where the type(m) == type(m[:]) idea had come from, as I had never formed it.) -- Michael Urman http://www.tortall.net/mu/blog ___

Re: [Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects

2006-12-06 Thread Michael Urman
aside, if you're trying to show that inconsistencies in a language are bad by referencing a paper showing that people who used consistent (if incorrect) mental models scored better than those who did not, you may have to explain further; I don't see the connection. -- Michael Urman h

Re: [Python-Dev] __str__ and unicode

2006-12-06 Thread Michael Urman
linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class Foo(object): ... def __unicode__(self): ... print "unicode" ... return u"hi" ... def __str__(self): ... print "str&

Re: [Python-Dev] Passing floats to file.seek

2006-11-13 Thread Michael Urman
say that it makes more sense to me than your reaction indicates. -- Michael Urman http://www.tortall.net/mu/blog ___ 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] Path object design

2006-11-04 Thread Michael Urman
as roots, but I don't know that there's any requirement for a /.. to be meaningless (even if it often is). -- Michael Urman http://www.tortall.net/../mu/blog ;) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/li

Re: [Python-Dev] PEP 351 - do while

2006-10-01 Thread Michael Urman
while True until False: # run once? run forever? while True until True: # run forever? run once? It's still very different from any syntactical syntax I can think of in python. I'm not sure I like the idea. Michael -- Michael Urman http://www.tortall.net/mu/blog ___

[Python-Dev] Change in file() behavior in 2.5

2006-09-07 Thread Michael Urman
pplication I work with, which used an explicit 'wU', that will currently stop working when people upgrade Python but not our application. Thanks, Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] SyntaxError: can't assign to function call

2006-08-10 Thread Michael Urman
t saying there's the use case to justify it, but I don't see anything that makes it a clear abomination or impossible with python's syntax. Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] Dict suppressing exceptions

2006-08-10 Thread Michael Urman
tion, we can satisfy both imagined camps. Those in Armin's position can make that warning raise an exception while debugging, and those using it on purpose can squash it. I understand the utility of being able to see this case happening. I'm not s

Re: [Python-Dev] unicode hell/mixing str and unicode as dictionary keys

2006-08-03 Thread Michael Urman
nnoying at times. We should fix those times, not the (unbroken) exception. Michael -- Michael Urman http://www.tortall.net/mu/blog ___ 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] unicode hell/mixing str and unicode as dictionary keys

2006-08-03 Thread Michael Urman
ersely affect behavior in only slightly edgy cases, perhaps it should go through a warning phase (which ideally could show the exception that was thrown, thus yielding most or all of the intended debugging advantage). Michael -- Michael Urman http://www.tortall.net/mu/blog __

Re: [Python-Dev] struct module and coercing floats to integers

2006-07-28 Thread Michael Urman
y the new implementation does not. [1] http://www.sacredchao.net/quodlibet/changeset/3706 Michael -- Michael Urman http://www.tortall.net/mu/blog ___ 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] Simple Switch statement

2006-06-26 Thread Michael Urman
case id(object): ... case id(None): ... else: switch value: case 1: ... case 'orange': else: raise ValueError Michael -- Michael Urman http://www.tortall.net/mu/blog ___ 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] Simple Switch statement

2006-06-26 Thread Michael Urman
o see a way to use 'is' instead of (or inaddition to) '==' for the comparison, but I don't have any use cases behind this. Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-05 Thread Michael Urman
s easy to tweak. However the part I didn't bring up as a reason to prefer explicit syntax for required-as-keyword is performance. I suspect syntactic support will be faster than **kw.pop; I'm almost certain it's faster than decorator gimmicks. I'm not certain at all that it's a

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-05 Thread Michael Urman
) on many of the C functions in the python stdlib. So what allowing named keyword-only arguments does for us is allows us to document this case. That is an absolute win. Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing lis

Re: [Python-Dev] more pyref: continue in finally statements

2006-05-02 Thread Michael Urman
ception. In your example this would result in an infinite loop. Alternately the behavior of return should be changed, and the below code would no longer work as it does today. >>> def foo(): ... try: raise Exception ... finally: return 'Done' ... >>> foo() &

Re: [Python-Dev] 3rd party extensions hot-fixing the stdlib (setuptools in the stdlib)

2006-04-19 Thread Michael Urman
m. So rather than extract the zip at install time (something purely within setuptool's domain), you found modifying pydoc's behavior to be a more compelling story. Are you aware that zipimport fails on 64-bit systems in Python 2.3, or do you plan to patch over that as well? Michael --

Re: [Python-Dev] a flattening operator?

2006-04-19 Thread Michael Urman
- y, x**y would not be the same as x * * y. Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailma

Re: [Python-Dev] Py3k: Except clause syntax

2006-03-16 Thread Michael Urman
ror, IndexError as e Michael -- Michael Urman http://www.tortall.net/mu/blog ___ 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] bytes.from_hex()

2006-03-01 Thread Michael Urman
k together, but 2b and 3c work with either complementary option. What other options do we have? Michael -- Michael Urman http://www.tortall.net/mu/blog ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev U

Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)

2006-03-01 Thread Michael Urman
inst the idea of the C++ rewrite as I also fail to see the advantages outweighing the disadvantages, especially in light of the amount of rewriting necessary to see the "advantages" cited so far.) Michael -- Michael Urman http://www.tortall.net/mu/blog __

Re: [Python-Dev] Proposal: defaultdict

2006-02-19 Thread Michael Urman
to be bind all checked names, but only if __contains__ returns True. Even though it would make a poor base implementation, and these effects aren't a good candidate for it, the code style that could best leverage such a __contains__ exists. Michael -- Michael Urman http://www.tortall.net/m

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Michael Urman
ove either in dict or a subclass compare to five line or smaller custom subclasses using something like the following? def append(self, k, val): self.setdefault(k, []).append(val) or def accumulate(self, k, val): try: self[k] += val except KeyError: self[k] = val Michael

Re: [Python-Dev] Let's just *keep* lambda

2006-02-07 Thread Michael Urman
help highlight its expression nature, but are they worth the change? MIchael -- Michael Urman http://www.tortall.net/mu/blog/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2006-01-06 Thread Michael Urman
ple things are easy to change or extend. Fixing the false positives and other misinterpretations is harder. http://www.tortall.net/mu/static/fmtcheck.py?raw - it takes a list of directories to os.walk for c source files. Michael -- Michael Urman http://www.tortall.net/mu/blog ___

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-20 Thread Michael Urman
On 12/19/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Michael Urman <[EMAIL PROTECTED]> wrote: > > Such as sorted(stuff, key=id)? > > I believe that ideally, canonical orderings would be persistant across > sessions. Erm, yes, I totally missed that in Jim&

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Michael Urman
On 12/19/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > That would be my preference. Comparison for canonical > ordering should be a distinct operation with its > own spelling. Such as sorted(stuff, key=id)? Michael -- Michael Urman http://www.tort

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-17 Thread Michael Urman
On 10/16/05, Nick Coghlan <[EMAIL PROTECTED]> wrote: > On and off, I've been looking for an elegant way to handle properties using > decorators. Why use decorators when a metaclass will already do the trick, and save you a line? This doesn't necessarily get around Antoine's complaint that it looks

Re: [Python-Dev] Adding a conditional expression in Py3.0

2005-09-23 Thread Michael Urman
sed so far. The obvious downsides are that it can raise a ValueError, and turns integers into floats. But if the input list is all numeric, it has clean results. -- Michael Urman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mail