of unicode chars, and
not bytes, I do not see how that would work. By analogy, perhaps you
mean to have '&#e9;' in your output instead of '\xe9\x21', but
those would not properly be xml numeric character references.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
model may help you understand Java better.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
, with a second submenu, but I am not familiar with how
those are done in Windows.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
sting comments.
Does anybody know or implement something like this or is there as
switrch, that I overlooked in hte documentaiton.
Assuming that you have not overlooked anything, I would just subclass
ConfigParser with an altered write method.
--
Terry Jan Reedy
--
http://mail.python.org/ma
an argument in favor.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
uncomfortable with this because it's misleading: a loop
that never loops.
I agree. Please do not do this in public ;-).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
may need to pass multiple conditions to pass. Putting them all in a
single large conjuction would obscure which is not passing.
However, anything is better than no tests.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
'f(a) + 3' would have to be written as '(f a) + 3', so saving of parens
anyway.
Also, is 'f a - 2' f(a -2) or f(a, -2)? A new precedence rule is needed
to disambiguage.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
;. Here are a couple more from their Library of Congress
Cataloging in Publication data: "Rev. ed. of: A manual of style." and
"Bibliography: p.". And in letters: "To:", "From:", and "Date:"
*A major style guide for general American writing and pu
On 3/16/2012 9:44 PM, John Nagle wrote:
Does anyone run PyPy in production?
The pypy list, accessible via gmane, might be a better place to ask. But
my impression is yes, and that they are getting commercial $$$ support.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python
d addition, replace unittest with the union of the two.
2. Put the try/except dance in a compat file. Then everywhere else 'from
compat import unittest'. This idea is one of those used to write code
that will run on both 2.x and 3.x
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 3/18/2012 4:55 PM, Andrea Crotti wrote:
On 03/18/2012 03:46 PM, Terry Reedy wrote:
1. If the difference between unittest and unittest2 is strictly a
matter of deletions and addition, replace unittest with the union of
the two.
2. Put the try/except dance in a compat file. Then everywhere
indicate that scientific English
fails as a human communication medium. Function docstrings say what the
function does and how to use it without reading the code. They can be
pulled out and displayed elsewhere. They also guide the reading of the
code. Abstracts serve the same functions.
--
Terry Jan
y would prefer not to
have to scroll past 100 lines of a tutorial with examples, tests and
what not in order to go from one function to another.
If I understand you, some devs agree. Hence the increasing use of How-to
docs with tutorial and example material for a module separate from the
reference
suggestions are very welcome.
I believe the intention is to release 3.3 compiled with VS 2010. Brian
Curtin and Martin Loewis are working on that. I believe people have
successfully built at least the basics with VS2010.
You could also dual boot to Linux and get 64 bit gcc for free.
--
Terry Jan
ext-managers
were readily available.
And before cyclic gc, which does a better job of ordering deletions.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
scan1
and leave your user code alone.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
the number and string
representation thereof, use repr(x).
>>> print(repr(3), repr('3'), [3, '3'])
3 '3' [3, '3']
Note that printing a collection prints the repr() of each item precisely
so one can tell the difference between the ite
b = c), or in Python, a = b==c.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
To get the particular bytes used for a particular string on a particular
system, OP should use the C API, possibly through ctypes.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Equality comparison is by id. So this code will not do what you want.
You can, of course, write a custom AssertX subclass that at least works
for your custom exception class.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
n-ascii chars as 'illegal' non-chars
(using the surrogate-pair second-half code units). This is probably the
safest in that invalid operations on the non-chars should raise an
exception. Re-encoding with the same setting will reproduce the original
hi-bit chars. The main danger is pa
support only a degenerate notion of comparison where any two objects of
that type are unequal." In other words, 'a==b' is the same as 'a is b'.
That is also the default for user-defined classes, but I am not sure
where that is documented, if at all.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 3/29/2012 3:18 AM, Ulrich Eckhardt wrote:
Am 28.03.2012 20:26, schrieb Terry Reedy:
On 3/28/2012 8:28 AM, Ulrich Eckhardt wrote:
[...]
# call testee and verify results
try:
...call function here...
except exception_type as e:
if not exception is None:
self.assertEqual(e, exception)
Did
to be O(1).
So all of the above is moot as far as the OP's problem is concerned. I
already gave him the three standard solutions.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
matical problem.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
t;> print( "We have $balls$ balls.")
We have 30 balls
You can already do essentially that without adding a special-case string
formatting method to the general methods we already have.
>>> balls = 5
>>> people = 3
>>> 'The {people} people have {balls} ba
efore that. Upgrade if you can to get fixes, suffer the bugs since
fixed, or patch your 2.6 installation.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
.worked:
hurray("I didn't even have to close the message in writing")
Looks great!
I never knew about that setting.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
y watching my mom. My knowledge of
how to crack open an egg properly and separate the yolk from the rest is
a wordless memory movie.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
ng?
I think it has been approved in principle, but still needs some people
to do something to actually make it happen.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
won't fix" because
"On 2008/2/23, Guido van Rossum said in python-dev
> According to the docstring it's only meant to be used with sched.py.
> Please don't try to make it work with threads!
Anyway, this module will be removed, or at least its API hidden, in 3.0."
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
result is to convert into a byte stream and then back:
bytes(s, 'utf-8').decode('unicode_escape')
This seems very ugly (and slightly 'wrong'). Is there no way to do
this without using bytes? Have I missed something?
>>> eval("'"+s+"
On 4/6/2012 6:05 PM, Cameron Simpson wrote:
On 06Apr2012 16:57, Terry Reedy wrote:
| On 4/6/2012 1:52 PM, Nicholas Cole wrote:
|>>>> bytes(s, 'utf-8').decode('unicode_escape')
|>
|> This seems very ugly (and slightly 'wrong'). Is there no
On 4/7/2012 7:20 AM, Rodrick Brown wrote:
This proposal was suggested in 2001 and is only now being
implemented. Why the extended delay?
It was implemented in revised form 3 years ago in 3.0.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
oes it make sense for us to try to use pyInstaller with a 32-bit
install of Python 3.2?
If you app runs within 2 GB, I would think yes.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
("C:/users/terry/data/somefile.txt")
I just verified that you can pass arguments with slashes, such as a
path, to a Python program from the shell. Here is my tem.py:
import sys
print(sys.argv)
If I run it from its directory as current path:
F:\Python\mypy>c:\programs\python32\pyth
ng to test, for which Idle is
excellent, and which I do all the time.
> like most human beings?
Snarkiness not helpful.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
turn funcs.g(funcs.h(a))
print(j(a, locals()))
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
cuts that use Ctrl on Windows and Linux use
Command on Mac OS X. If you don't specify Mac, we're going to give you
the options that work on Windows and Linux.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
mostly irrelevant to the abstract operation of repeated partitioning
to process each item of a collection.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Python-2.7.3.tar.xz
verified and forwarded to pydev list for correction.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
easier because each
digit is 0 or 1 so no guessing needed as with base 10.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
2.7.3 release? It has hundreds of bug
fixes not in 2.6.x.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
>>> s = r'abc\cd\ef'
>>> bs = '\\'
>>> bs2 = bs+bs
>>> s.replace(bs, bs2)
'abc\\\\cdef'
>>> len(s.replace(bs, bs2))
11
# and continue to use bs and bs2
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
ections on coordinate axes. If a = 1,2,3 and b = 3,2,1 are
(mathematical) vectors, then a+b = 4,4,4; 2*a = 2,4,6; and a*b = (3+4+3)
= 10.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
en('c:/windows/temp/test', 'r')
You only need backslashes when entering filenames in Command Prompt
window that Command Prompt must interpret as a path.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
3.3 is de facto
acceptance of that as *one* recommended method.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 4/15/2012 6:59 PM, Ian Kelly wrote:
On Sun, Apr 15, 2012 at 4:49 PM, Terry Reedy wrote:
On 4/15/2012 12:16 PM, Ian Kelly wrote:
On Sat, Apr 14, 2012 at 8:57 PM, Shmuel Metz
wrote:
In<87aa2iz3l1@kuiper.lan.informatimago.com>, on 04/11/2012
at 05:32 PM, "Pascal J.
arn the
RST markup language used for the docs?
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
'Header'
P = 'Paragragh'
Then dump all the reverse-curried helpers.
obj.append(T, 'On Learning Something New About Python')
obj.append(H, 'A Question Is Posed')
obj.append(P, 'Where is lorem ipsum when you need it?')
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
x27;
>>> 'frame{:0>5d}.jpg'.format(21)
'frame00021.jpg'
You might consider saving .bmp bitmaps, as mpeg compresses across frames
as well as within frames. If you have sprites moving over a static
background, only the changes need to be encoded.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
34145bbdd&mimetype=text/plain
It starts 'Current Release: 0.7'
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
ails is in this code fragment:
case POP_BLOCK:
assert(blockstack_top> 0);
This looks like a genuine bug in the CPythin interpreter to me.
Looks like something to report on the tracker bugs.python.org
If either of you do that, please include details above.
--
Terry Jan
On 4/18/2012 10:22 AM, Kiuhnm wrote:
The bug was confirmed and a patch is now available:
http://bugs.python.org/issue14612
And applied to 2.7, 3.2, and 3.3.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
r some helper functions that it uses.
That calls helper _dir_object(), which calls a more specialized helper
if ob.__dir__ does not exist.
Even if this does not help you, I learned something about the source
tree in tracking down the answer.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/li
."
I'm also tired of hearing mottos such as TIMTOWTDI...
> oops, that's Perl.
I think Tim meant for the Zen to be a summary and stimulus of thought,
not a substitute for thought.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
ctools module.
* One consistent signature that people could remember would be
reduce3(update(current,next), initial_current, source_of_nexts)
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
r object. The automatic local
namespace binding of a def function can be explicitly undone, just like
any other binding. So any function, regardless of creation syntax, can
be named or not in any namespace, just like any other object.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
category. Sum requires an iterable of
mutually addable objects, with the specific class or category (such as
'number') again determined by the initial value.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
local
scopes -- because they are abbreviated def statements. But they cannot
contain statements, only expressions, in that new scope.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 4/19/2012 5:32 PM, Cameron Simpson wrote:
On 19Apr2012 14:32, Terry Reedy wrote:
| On 4/19/2012 11:51 AM, Jacob MacDonald wrote:
|> When I talk about an iterable, I say "iterable".
|
| Ditto.
I used to, but find myself saying "sequence" these days. It reads
better, b
On 4/19/2012 6:16 PM, Cameron Simpson wrote:
On 19Apr2012 18:07, Terry Reedy wrote:
| On 4/19/2012 5:32 PM, Cameron Simpson wrote:
|> On 19Apr2012 14:32, Terry Reedy wrote:
|> | On 4/19/2012 11:51 AM, Jacob MacDonald wrote:
|> |> When I talk about an iterable, I s
different way. I'm not an expert I just see it's different :)
It might be a server problem although I think the lib should behave
equals for all versions.
Not when bugs are fixed and improvements made ;-)
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 4/20/2012 9:41 AM, Roy Smith wrote:
Except that "list of foos" and "sequence of foos" make sense from a
grammar standpoint, but "iterator of foos" does not. Or maybe it does?
I consider it grammatical, but idiomatically, it *is* an innovation.
Language evolv
ncluding pop() and next(), that mutate by
removing and returning an object, while remaining consistent with the rule.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
the above has always been the case for CPython.
CPython's set of pre-built ints has been expended. I think string
interning has also changed.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
ded officially,
many people routinely wrote in their code:
False, True = 0, 1
and that locking the names, when it was done in 3.0, broke such code?
And that is was not done earlier to avoid breaking code earlier, in
accordance with the general policy to mostly avoid such breakage?
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 4/23/2012 12:38 AM, Devin Jeanpierre wrote:
On Sun, Apr 22, 2012 at 9:22 PM, Terry Reedy wrote:
On 4/22/2012 3:43 PM, John Nagle wrote:
On 4/20/2012 9:34 PM, john.tant...@gmail.com wrote:
On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote:
I believe it says somewhere in the
not separate from value.
Concrete computational process objects do.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
l expression of
string theory and the answer would be False. If it means "The person
connected with the name 'Bob' at this time in the currect context is the
same person connected with 'Robert'", then it is not a mathematical
question but is contingent# on the facts
" still succeeds.
os.access() always reports that the file is readable (i.e. "true")
If I simply call up the python interpreter (python 2.6 - Debian stable)
and manually "import x" - there is no problem - both work.
sys.path might be different in the two modes.
the only way to test identity is:
id(x) == id(y)
Though I would prefer:
addr(x) == addr(y)
myself, again, for what little it matters.
The fact that id(x) is machine_addr(x) in CPython is specific to
CPython, not required by the language spec, and not true in
implementations that move
not stating that it is compliant), which also does not
recognize zero field length records.
Feel free to open a tracker issue suggesting specific doc changes.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Why?
Before proceeding, I would check the current 2.7.3 code.
It is possible that the comment is obsolete.
You might be a better idea if you clone the hg repository and check the
history for when those two lines were last modified.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
tring representations of functions, classes, and modules.
The real 'culprits' for (potentially) forcing objectness are everyday
indexing and iteration. Numpy avoids boxing internal binary values by
providing functions that operate on numpy arrays *without* exposing the
internal values
called.
This is essentially what Idle does to display python output to its window.
>>> import sys; sys.stdout
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
anged thus mutable.
The default hash is based on the immutable value of an object. If you
base a custom hash on values that do change, it is not useful as a dict key.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
at a time).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
does not change.
Under what circumstances does an object's hash value change?
When someone has written a buggy .__hash__ method. Or perhaps if someone
is making a non-standard, non-dict use of hash().
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 4/29/2012 6:05 AM, Terry Reedy wrote:
On 4/29/2012 3:59 AM, J. Mwebaze wrote:
I am just wondering which specific algorithm does python use to compare
two strings.
'Python' does not use algorithms, implementations do. CPython may check
id and or hash before doing a charact
in Google Groups. I can see replies in OE, so
they are being accepted. I send to the group gmane.comp.python.general.
Does anyone know a reason for this, or have a solution?
Read and post through news.gmane.org
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 4/30/2012 6:41 AM, viral shah wrote:
Hi
I want to make a pattern like this
*1
22
333
5
Python 3:
>>> for i in range(1,6): print(i*str(i))
1
22
333
5
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
ems, and then
merges. The practical time is O(n). Ditto for sorting an already sorted
file in the reverse direction (timsort does an O(n) list reverse).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 5/2/2012 10:49 AM, Nikhil Verma wrote:
This was posted as html (with text copy). Please send messages to the
list and newsgroup as text (only). Html sometimes does strange things,
especially if you post code.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
nd creating a key:file-offset dict. Each value
would start with length(value) so that is not needed in memory. The
dict, once created, could be pickled and unpickled for each run.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
where.
Python 3.3.0a3 (default, May 1 2012, 16:46:00)
>>> hash('a')
-292766495615408879
>>> hash(-292766495615408879)
-292766495615408879
>>> a = {'a', -292766495615408879}
>>> b = {-292766495615408879, 'a'}
>>> lis
On 5/4/2012 12:52 AM, John O'Hagan wrote:
Just read the thread on pyjamas-dev. Even without knowing anything about the
lead-up to the coup, its leader's linguistic contortions trying to justify it
And what is the name of the miscreant, so we know who to have nothing to
with?
--
trary. It is frustrating
that people do not want to believe that, and even write tests depending
on today's arbitrary serialization order being deterministic
indefinitely. There is a section about this in the doctest doc, but
people do it anyway. I will think about a sentence to
rint line
print first, last
print range(first + 5, last - 1)
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
works for that one run, as hash('a') changes each run. So
iteration order now changes with each run in fact as well as in theory.
For the doc, the problem is what to say and where without being
repetitous (and to get multiple people to agree ;-).
--
Terry Jan Reedy
--
http://mail.
, however,
a bit OT for this list. On the other hand, it is encouraging that Python
is now routinely listed as a major language in such things. Not so when
I learned it 16 years ago ;-).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
backwards. Risinger forked the project with a new code
host and mailing list, but stole the name and and some data in the
process and made the false claim that his fork was the original. It is
not clear if he damaged anything in the process.
If Luke continues his original project, it would sti
On 5/8/2012 12:42 PM, Chris Angelico wrote:
On Wed, May 9, 2012 at 2:12 AM, Terry Reedy wrote:
You still have it backwards. Risinger forked the project with a new code
host and mailing list, but stole the name and and some data in the process
and made the false claim that his fork was the
situation-specific details.
For instance
errfmt = "Security question length {:d} not in legal range {:d} - {:d}"
if not (secquemin <= len(secque) <= secquemax):
raise ValueError(errfmt.format(len(secque), secquemin, secquemax))
# or ApplicationError or AppValueError if you want.
here answers, try Debian or numpy lists.
Comment: the import machinery is heavily revised for 3.3. I believe
is new. I believe relative imports may
have been changed to fix bugs. One could have been introduced (though
there are no reports on the tracker). If so, we need to fix it. Or
perhaps there is something special about __init__ I am not aware of.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 5/8/2012 5:47 PM, Terry Reedy wrote:
From what others have posted, it has a new code repository (that being
the ostensible reason for the fork), project site, and mailing list --
the latter two incompetently. Apparently, the only thing he has kept are
the domain and project names (the
e last line of the if-block and first line of the
else-block, and there is a gap, you might guess that the else is in
between ;-).
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
the
string content. If the argument is outside the integer range a
long object will be returned instead. """
'error' should say 'TypeError' as it is a TypeError to provide the wrong
number of args. However, the current 3.3 manual entry is more accurate
and informative, starting with the signature.
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Read the sympy doc and learn how to make a Function and use tsolve
correctly?
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
601 - 700 of 8120 matches
Mail list logo