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
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
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
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
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
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
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
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
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
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
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:
>>>
>>> %
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
___
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
__
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
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
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
; 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
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
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
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
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
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
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
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
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
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
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.
--
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
"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
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
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
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
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.
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
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
___
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
> 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
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
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@
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
___
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
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&
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
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
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
___
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
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
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
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
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
__
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
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
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
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
) 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
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()
&
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
--
- 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
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
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
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
__
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
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
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://
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
___
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&
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
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
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
84 matches
Mail list logo