Re: Why are some unicode error handlers "encode only"?

2012-03-11 Thread Terry Reedy
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

Re: How Python empowers Java?

2012-03-12 Thread Terry Reedy
model may help you understand Java better. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Contextmenu

2012-03-13 Thread Terry Reedy
, 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

Re: Is there a ConfigParser which keeps comments

2012-03-14 Thread Terry Reedy
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

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-14 Thread Terry Reedy
an argument in favor. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question (Poll)

2012-03-14 Thread Terry Reedy
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

Re: How to break long method name into more than one line?

2012-03-14 Thread Terry Reedy
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

Re: Why not use juxtaposition to indicate function application

2012-03-16 Thread Terry Reedy
'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

Re: Python is readable

2012-03-16 Thread Terry Reedy
;. 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

Re: Does anyone actually use PyPy in production?

2012-03-16 Thread Terry Reedy
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

Re: Unittest2 on python 2.6

2012-03-18 Thread Terry Reedy
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

Re: Unittest2 on python 2.6

2012-03-18 Thread Terry Reedy
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

Re: Python is readable

2012-03-20 Thread Terry Reedy
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

Re: Python is readable

2012-03-20 Thread Terry Reedy
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

Re: Compiling Python (modules) on 64bit Windows - which compiler suite?

2012-03-21 Thread Terry Reedy
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

Re: Best way to disconnect from ldap?

2012-03-22 Thread Terry Reedy
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

Re: why did GMPY change the names of its functions?

2012-03-26 Thread Terry Reedy
scan1 and leave your user code alone. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any difference between print 3 and print '3' in Python ?

2012-03-26 Thread Terry Reedy
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

Re: Documentation, assignment in expression.

2012-03-26 Thread Terry Reedy
b = c), or in Python, a = b==c. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Terry Reedy
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

Re: unittest: assertRaises() with an instance instead of a type

2012-03-28 Thread Terry Reedy
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

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Terry Reedy
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

Re: unittest: assertRaises() with an instance instead of a type

2012-03-29 Thread Terry Reedy
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

Re: tabs/spaces

2012-03-29 Thread Terry Reedy
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

Re: "convert" string to bytes without changing data (encoding)

2012-03-29 Thread Terry Reedy
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

Re: Python is readable

2012-03-30 Thread Terry Reedy
matical problem. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: string interpolation for python

2012-03-31 Thread Terry Reedy
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

Re: Tkinter: IDLE can't get out of mainloop

2012-03-31 Thread Terry Reedy
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

Re: tabs/spaces

2012-04-02 Thread Terry Reedy
.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

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-04-03 Thread Terry Reedy
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

Re: regexp partial matching, or hitEnd

2012-04-05 Thread Terry Reedy
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

Re: Python Gotcha's?

2012-04-05 Thread Terry Reedy
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

Re: 'string_escape' in python 3

2012-04-06 Thread Terry Reedy
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+"&#x

Re: 'string_escape' in python 3

2012-04-06 Thread Terry Reedy
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

Re: PEP 274

2012-04-07 Thread Terry Reedy
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

Re: Distribute app without source?

2012-04-07 Thread Terry Reedy
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

Re: f python?

2012-04-08 Thread Terry Reedy
("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

Re: Question on Python 3 shell restarting

2012-04-09 Thread Terry Reedy
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

Re: functions which take functions

2012-04-09 Thread Terry Reedy
turn funcs.g(funcs.h(a)) print(j(a, locals())) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Python 3 shell restarting

2012-04-10 Thread Terry Reedy
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

Re: f python?

2012-04-10 Thread Terry Reedy
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

Re: Error in MD5 checksums of the 2.7.3 release page.

2012-04-12 Thread Terry Reedy
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

Re: remainder of dividing by zero

2012-04-12 Thread Terry Reedy
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

Re: Subprocess troubles from a daemon

2012-04-13 Thread Terry Reedy
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

Re: escaping

2012-04-15 Thread Terry Reedy
>>> 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

Re: f python?

2012-04-15 Thread Terry Reedy
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

Re: No such file or directory: 'c:\\windows\\temp\\test'

2012-04-15 Thread Terry Reedy
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

Re: Python Gotcha's?

2012-04-15 Thread Terry Reedy
3.3 is de facto acceptance of that as *one* recommended method. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: f python?

2012-04-15 Thread Terry Reedy
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.

Re: contributing to sqlite documentation

2012-04-16 Thread Terry Reedy
arn the RST markup language used for the docs? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Making helper methods more concise

2012-04-16 Thread Terry Reedy
'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

Re: pygame: output to file?

2012-04-16 Thread Terry Reedy
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

Re: Pyjamas 0.8.1~+alpha1 released

2012-04-16 Thread Terry Reedy
34145bbdd&mimetype=text/plain It starts 'Current Release: 0.7' -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in Python

2012-04-17 Thread Terry Reedy
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

Re: Bug in Python

2012-04-18 Thread Terry Reedy
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

Re: how python dir works

2012-04-18 Thread Terry Reedy
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

Re: Framework for a beginner

2012-04-19 Thread Terry Reedy
." 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

Re: Framework for a beginner

2012-04-19 Thread Terry Reedy
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

Re: Framework for a beginner

2012-04-19 Thread Terry Reedy
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

Re: How do you refer to an iterator in docs?

2012-04-19 Thread Terry Reedy
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

Re: with statement

2012-04-19 Thread Terry Reedy
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

Re: How do you refer to an iterator in docs?

2012-04-19 Thread Terry Reedy
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

Re: How do you refer to an iterator in docs?

2012-04-19 Thread Terry Reedy
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

Re: Different results for different versions of urllib2

2012-04-20 Thread Terry Reedy
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

Re: How do you refer to an iterator in docs?

2012-04-20 Thread Terry Reedy
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

Re: Appending to []

2012-04-21 Thread Terry Reedy
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

Re: why () is () and [] is [] work in other way?

2012-04-21 Thread Terry Reedy
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

Re: why () is () and [] is [] work in other way?

2012-04-22 Thread Terry Reedy
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

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Terry Reedy
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

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Terry Reedy
not separate from value. Concrete computational process objects do. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Terry Reedy
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

Re: Strange __import__() behavior

2012-04-25 Thread Terry Reedy
" 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.

Re: why () is () and [] is [] work in other way?

2012-04-25 Thread Terry Reedy
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

Re: csv: No fields, or one field?

2012-04-26 Thread Terry Reedy
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

Re: Is "PyIntBlocks are never returned to the system before shutdown" right?

2012-04-26 Thread Terry Reedy
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

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Terry Reedy
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

Re: (3.2) Overload print() using the C API?

2012-04-27 Thread Terry Reedy
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

Re: confusing doc: mutable and hashable

2012-04-28 Thread Terry Reedy
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

Re: algorithm does python use to compare two strings

2012-04-29 Thread Terry Reedy
at a time). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: confusing doc: mutable and hashable

2012-04-29 Thread Terry Reedy
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

Re: algorithm does python use to compare two strings

2012-04-29 Thread Terry Reedy
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

Re: Some posts do not show up in Google Groups

2012-04-30 Thread Terry Reedy
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

Re: For loop

2012-04-30 Thread Terry Reedy
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

Re: Sort comparison

2012-05-01 Thread Terry Reedy
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

Re: DateTime objectFormatting

2012-05-02 Thread Terry Reedy
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

Re: key/value store optimized for disk storage

2012-05-02 Thread Terry Reedy
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

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-03 Thread Terry Reedy
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

Re: pyjamas / pyjs

2012-05-04 Thread Terry Reedy
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? --

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Terry Reedy
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

Re: for loop: weird behavior

2012-05-04 Thread Terry Reedy
rint line print first, last print range(first + 5, last - 1) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: When convert two sets with the same elements to lists, are the lists always going to be the same?

2012-05-04 Thread Terry Reedy
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.

Re: Workshop on Design Patterns and Advanced OOPS, Bangalore

2012-05-07 Thread Terry Reedy
, 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

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Terry Reedy
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

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Terry Reedy
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

Re: How to get outer class name from an inner class?

2012-05-08 Thread Terry Reedy
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.

Re: Using modules from Debian "python3-..." packages with locally compiled Python 3.3

2012-05-08 Thread Terry Reedy
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

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Terry Reedy
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

Re: Finding the line number of an 'else' statement via ast

2012-05-11 Thread Terry Reedy
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

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Terry Reedy
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

Re: to solve the simple equation

2012-05-12 Thread Terry Reedy
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

<    2   3   4   5   6   7   8   9   10   11   >