On Tue, May 27, 2014 at 4:05 AM, Chris Angelico ros...@gmail.com wrote:
On Tue, May 27, 2014 at 6:58 PM, Serhiy Storchaka storch...@gmail.com 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
On Thu, Jan 16, 2014 at 8:45 AM, Brett Cannon br...@python.org 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
On Thu, Jan 16, 2014 at 11:13 AM, Neil Schemenauer n...@arctrix.com 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__
On Mon, Jan 6, 2014 at 9:43 AM, Guido van Rossum gu...@python.org 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
On Thu, Jul 11, 2013 at 6:58 PM, Christian Heimes christ...@python.org 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
On Tue, May 7, 2013 at 8:34 AM, Eli Bendersky eli...@gmail.com 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
questions, as it's unclear
whether each name should get its own representation, or whether it's better
to let DupEnum.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
On Fri, Apr 12, 2013 at 9:30 AM, Barry Warsaw ba...@python.org 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 show the original
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-Dev mailing list
Python-Dev@python.org
http
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 too long for the window size.
--
Michael Urman
On Sun, Oct 23, 2011 at 17:15, Mark Hammond skippy.hamm...@gmail.com 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
On Sun, Oct 23, 2011 at 20:58, Mark Hammond mhamm...@skippinet.com.au wrote:
On 24/10/2011 12:56 PM, Michael Urman wrote:
On Sun, Oct 23, 2011 at 17:15, Mark Hammondskippy.hamm...@gmail.com
wrote:
How about abusing the existing flags for this purpose - eg:
% py -3?
% py -2.7?
I would
/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
___
Python-Dev mailing list
Python-Dev@python.org
http
, 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 mailing list
Python-Dev@python.org
http
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/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
--
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 Mon, May 9, 2011 at 23:09, Neil Hodgson nyamaton...@gmail.com 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 outside of ASCII safely. So while
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 could see erroring out as refus[ing] the temptation to
guess.
--
Michael Urman
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
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 mar...@v.loewis.de 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
On Wed, Feb 2, 2011 at 15:27, Hoyt, David ho...@llnl.gov 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
On Tue, Jun 22, 2010 at 00:28, Stephen J. Turnbull step...@xemacs.org 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 you want something idempotent
On Tue, Jun 22, 2010 at 15:32, Terry Reedy tjre...@udel.edu 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 built on the
basic functions
with int.
int(4, 0)
TypeError: int() can't convert non-string with explicit base
--
Michael Urman
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman
()
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.org
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
Python-Dev@python.org
http
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.
--
Michael Urman
___
Python-Dev mailing list
On Thu, May 7, 2009 at 00:43, Martin v. Löwis mar...@v.loewis.de wrote:
Michael Urman wrote:
On Wed, May 6, 2009 at 15:42, Martin v. Löwis mar...@v.loewis.de wrote:
Despite there being also an error handler called surrogates.
Not that I have to be, but I'm not sold on the previous UTF-8 codec
).
--
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
of the handler rather than the algorithm, but
is awkward on encode when it encounters unavailable Unicode
characters.
--
Michael Urman
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
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-Dev mailing list
Python-Dev@python.org
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.org/mailman/options/python-dev/archive
, 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-dev
(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:
http://mail.python.org/mailman/options/python-dev/archive%40mail
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
___
Python-Dev mailing list
Python-Dev@python.org
http
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 mailing list
Python-Dev@python.org
lightly.
I see little reason that this couldn't be a new codec or error handler
that allowed people to choose between correct pure UTF-8 behavior or
the technically incorrect but very practical behavior it currently
has.
[My apologies, Adam, for sending this only to you the first time]
--
Michael
that their users (other
developers) do.
--
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
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@python.org
http://mail.python.org/mailman/listinfo
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 bytestring provided
to the ANSI function.
--
Michael Urman
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
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/mailman/listinfo/python-dev
Unsubscribe:
http
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://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
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(int, (42, 6.022, 2**32))
[42, 6, 4294967296L]
--
Michael Urman
into Python 2.x
you'd be unable to use until you no longer needed it. However your
later example of the PageTemplateFile, which appears to be due to a
third-party module reorganization and could certainly happen during
the lifetime of late 2.x, helps swing me back the other way.
--
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 different than a 32-Bit installer package
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 type is 0x8664.
I've looked most closely at
http
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.python.org/ftp/python/2.5.1/python-2.5.1.amd64
, 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
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
, 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://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
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-Dev@python.org
http://mail.python.org/mailman
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
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe
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
___
Python-Dev mailing list
Python-Dev@python.org
http
, copyright, credits or license for more information.
class Foo(object):
... def __unicode__(self):
... print unicode
... return uhi
... def __str__(self):
... print str
... return hello
...
unicode(Foo())
unicode
u'hi'
--
Michael Urman http://www.tortall.net/mu/blog
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 http://www.tortall.net/mu/blog
___
Python-Dev mailing list
Python-Dev
.
--
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
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/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail
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
', 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@python.org
http://mail.python.org/mailman/listinfo/python-dev
understand the utility of being able to see this case happening. I'm
not sure it's worth the warning. I'm positive it's not worth the
backwards incompatibility of the raised exception.
Michael
--
Michael Urman http://www.tortall.net/mu/blog
___
Python-Dev
yielding
most or all of the intended debugging advantage).
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
--
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
that
the construct is bad. I will accept any of the options, as it's clear
that floats don't make sense. It's just unfortunate that the previous
implementation let them through in a way the new implementation does
not.
[1] http://www.sacredchao.net/quodlibet/changeset/3706
Michael
--
Michael Urman
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@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
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 list
Python-Dev@python.org
http://mail.python.org/mailman
* * 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/mailman/options/python-dev/archive%40mail-archive.com
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
--
Michael Urman http://www.tortall.net/mu/blog
. Nobody would expect the second import to rename both items to
q, and the first except clause would be a SyntaxError.
from foo import bar as b, quux as q
except TypeError as te, IndexError as ie
from foo import bar, quux as q
except TypeError, IndexError as e
Michael
--
Michael
, 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
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
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
Unsubscribe:
http://mail.python.org/mailman
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/mu/blog
___
Python-Dev mailing list
Python-Dev@python.org
http
):
try: self[k] += val
except KeyError: self[k] = val
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
, 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://mail.python.org/mailman/options/python-dev/archive
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
___
Python-Dev mailing list
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's original preferred
requirements. And I nearly
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.tortall.net/mu/blog
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
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/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options
79 matches
Mail list logo