Re: Help

2013-07-25 Thread Terry Reedy
s you have a very specialized purpose, it would be more educational about Python programming. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Division and multiplication have a different behavior in the overflow case

2013-07-27 Thread Terry Reedy
int too large to convert to float I think the multiplication should have the same behavior than the division: * `inf` or `-inf` when the operands are inside the limits, but the result is not * `OverflowError` when the result, and at least one operand, are out of range. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: FSR and unicode compliance - was Re: RE Module Performance

2013-07-28 Thread Terry Reedy
ion cannot associate additional data with a string to make processing of the string easier. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-28 Thread Terry Reedy
ple is creating a list of a million tuples, which otherwise triggers a lot of useless background bookkeeping. The cyclic gc is tuned for 'normal' use patterns. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic type returning NameError:

2013-07-28 Thread Terry Reedy
whatever = type("WhatEver", (obj,), {"method1": super(WhatEver, self).request("method1")}) 'method1' has to be mapped to a function object. but when i try this I get 'NameError: name 'self' is not defined' defining these c

Re: AssertionError: Headers already set! Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59

2013-07-29 Thread Terry Reedy
e: text/plain Content-Length: 59 You should have made subject line something like "Webapp2: AssertionError" as only someone familiar with webapp2 could give you any help. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected results comparing float to Fraction

2013-07-29 Thread Terry Reedy
(6004799503160661, 18014398509481984) > So from that standpoint it makes sense to me to cast to > Fraction when comparing. Otherwise, == becomes non-transitive -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you do when a library is outdated?

2013-07-29 Thread Terry Reedy
te it yourself, ask someone else to update it, or use something else. Or regress to an older Python that it will work with. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected results comparing float to Fraction

2013-07-29 Thread Terry Reedy
On 7/29/2013 1:29 PM, Steven D'Aprano wrote: On Mon, 29 Jul 2013 13:08:20 -0400, Terry Reedy wrote: In other words, there can be multiple unequal Franctions that have the same float value: for instance, Fraction(1,3) and Fraction(6004799503160661, 18014398509481984) > So f

Re: PEP8 79 char max

2013-07-29 Thread Terry Reedy
ve, the recommended limit will be raised to 100, or at least say that some are using that as the guideline. 200 char lines are harder to read. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8 79 char max

2013-07-29 Thread Terry Reedy
On 7/29/2013 5:01 PM, Terry Reedy wrote: On 7/29/2013 3:43 PM, Devyn Collier Johnson wrote: In Python programming, the PEP8 recommends limiting lines to a maximum of 79 characters because "There are still many devices around that are limited to 80 character lines" "plus, limi

Re: Bitwise Operations

2013-07-29 Thread Terry Reedy
you are set to go. Have fun. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-30 Thread Terry Reedy
On 7/30/2013 1:40 PM, Joshua Landau wrote: Additionally, who says a language couldn't use, say, B-Trees for all of its list-like types, including strings? Tk apparently uses a B-tree in its text widget. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python descriptor protocol (for more or less structured data)

2013-07-31 Thread Terry Reedy
nit__(self, two=None): self.two = Value(two if two is not None else C.two) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Terry Reedy
to be a standalone objects when there is an obvious alternative (in this case, bytes). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking compatibility of a script across Python versions automatically

2012-06-18 Thread Terry Reedy
make them compatible with 3.0 and 3.1 if they aren't already. Forget about 3.0. Really. As for 3.1 versus 3.2, there were no core syntax changes in 3.2. There were a few, but only a few, enhancements in builtin classes. If you have a decent test suite, just run it under 3.1. -- Terry Jan

Re: Custom build of Python

2012-06-20 Thread Terry Reedy
something that will help you. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: DirectX Screenshot with python possible?

2012-06-20 Thread Terry Reedy
uch a function. If not, someone on the pygame list must know how. (I am assuming that sdl library and hence pygame use directx.) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: None shown in output

2012-06-21 Thread Terry Reedy
, 'minus')) print "%r" % (get_numbers(1+3, 2+9, 'add')) print "%r" % (get_numbers(10, 2, 'divide')) Output: C:\code\python>ex19.py -1 None 15 None 5 None 7.5 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-22 Thread Terry Reedy
ony in what he intended to be a refutation of Wolfgang Keller's comment ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL handshake hanging, despite bugfix in stdlib

2012-06-23 Thread Terry Reedy
ll is moved and has a different context. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL handshake hanging, despite bugfix in stdlib

2012-06-25 Thread Terry Reedy
On 6/25/2012 8:34 AM, Michael Gundlach wrote: Hello again Terry (and mailing list), On Sun, Jun 24, 2012 at 9:34 AM, Michael Gundlach mailto:gundl...@gmail.com>> wrote: I've now changed to 2.7.3, and if I don't write back in the next few days, it means that that f

Re: How can i call array_length to get the length of array object?

2012-06-25 Thread Terry Reedy
x27;s no call for such vitriol. Please keep it off this forum. From http://www.thefreedictionary.com/vitriol - "Bitterly abusive feeling or expression." I do not believe that my comment above deserves the term vitriol. I saw it more as sarcasm and an expression of frustration.

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Terry Reedy
was relaxed. Complete agreed. I have used all of sep=, end=, and file= at various times. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: json.loads() should return a more specific error

2012-06-27 Thread Terry Reedy
he raising code knows and that is hard to get otherwise. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to6 ?

2012-06-27 Thread Terry Reedy
, or how feasible that would be. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Terry Reedy
1. They will confuse themselves by thinking that 'u' actually means somethings. They may then confuse others by writing about its supposed meaning. This might get amusing. 2. They will use 'u' in Python 3 only code, thereby making it incompatible with 3.2-, even if it

Re: TKinter Frame Size automatic

2012-06-28 Thread Terry Reedy
that you could resize the main window after inserting tab widgets but before displaying. If not, you should be to create the widgets first, find the largest height and width, create the master, and then put the widgets into the master, changing their 'master' attribute. -- Terry

Re: moving methods from class to instance of other class

2012-06-28 Thread Terry Reedy
B() b.do() # print (with print adjusted for PY3) A.do: self.name = b If you want a B instance to act like an A instance, you can change its class (subject to some limitations). The following works. b = B() b.__class__ = A b.do() If make the change temporary and the reversion automatic, writ

Re: code review

2012-06-29 Thread Terry Reedy
may really not know what came from where from x import y,x # fine, common, used in stdlib import x as y # ditto from x import y as z # ditto -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: code review

2012-06-29 Thread Terry Reedy
the name-space ref does make it easy to identify the origins of a function (at the expense of more typing) import tkinter as tk for example, to minimize extra typing while identifying source. ___ Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: code review

2012-06-30 Thread Terry Reedy
x27;t be necessary), or make an educated guess, which would almost certainly be correct, but we're supposed to refuse the temptation to guess, right? Python pretty consistently evaluates expressions and equal precedence operators left to right. One really should learn that. No 'implement

Re: how to use tkinter in python3.2?

2012-06-30 Thread Terry Reedy
thon3 Python 3.1.3 (r313:86834, Nov 28 2010, 11:28:10) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter and who compiled that (correctly)? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: code review

2012-07-01 Thread Terry Reedy
erators as comparison operators, and gives them behaviour appropriate to comparisons. I considered this a great feature of Python when I first learned it. Reading about how rare it is among programming languages to treat comparisons in the standard way in mathematics reinforces that. -- Terry

Re: code review

2012-07-02 Thread Terry Reedy
main points of the language take just a few hours to review. Perhaps my advantage learning Python was that I had written code in over 10 other languages and dialects and so had few expectations and made few assumptions. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: how to solve this tclerror?

2012-07-02 Thread Terry Reedy
On 7/2/2012 10:14 AM, contro opinion wrote: i solve it myself 1.download tile-0.8.4.0.tar.gz Or install the latest tcl/tk 8.5(.11), which includes tile/tkk and bug fixes, instead of the rather old 8.4.?. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to6 ?

2012-07-02 Thread Terry Reedy
On 7/2/2012 11:02 AM, Thomas Heller wrote: Am 27.06.2012 20:06, schrieb Terry Reedy: On 6/27/2012 10:36 AM, Thomas Heller wrote: Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Others have expressed a

Re: helping with unicode

2012-07-02 Thread Terry Reedy
').encode('utf-8') == x but on cmd, it print broken characters Printing utf-8 encoded bytes as if cp949 encoded bytes is pretty hilariour the question may look silly:( but I want to know what is the problem or how to print the not broken strings. thanks for reading. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: helping with unicode

2012-07-02 Thread Terry Reedy
').encode('utf-8') == x but on cmd, it print broken characters Printing utf-8 encoded bytes as if cp949 encoded bytes is pretty hilariour the question may look silly:( but I want to know what is the problem or how to print the not broken strings. thanks for reading. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictless classes

2012-07-03 Thread Terry Reedy
.M object at 0x0220A1C0> None False Is C a dictless class? Your choice ;-). Actually, Python thinks not. If we add class Mclassob(object): pass and have __call__ return an instance thereof and try c.__class__ = C we get TypeError: __class__ must be set to a class, not &

Re: 2 + 2 = 5

2012-07-04 Thread Terry Reedy
tively, I still get 3. Maybe the constant folder is always on now. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Which way is best to execute a Python script in Excel?

2012-07-05 Thread Terry Reedy
he non-existent com.sun.star.ui module. Still, a lot more is needed to understand even the example. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Which way is best to execute a Python script in Excel?

2012-07-05 Thread Terry Reedy
. Writing non-api code is relatively easy; accessing the OO/LO api is harder. I made a start. When I get further, I will look at the examples that are close to some things I want to do. I will also study your Python examples. Thanks for the help. Terry -- http://mail.python.org/mailman/listinfo

Re: Tkinter.event.widget: handler gets name instead of widget.

2012-07-08 Thread Terry Reedy
gs are on the Labels, not a containing Frame. # Dell E6500, Ubuntu 10.04, Python 2.6 You might try a current Python release, and the latest tcl/tk 8.5.11 released last March (comes with 3.3.0 Windows release, don't know how on Ubuntu). There might be (have been?) a bug with events on Frames, or on Frames within Frames treated as widgets. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I make it work?

2012-07-08 Thread Terry Reedy
On 7/8/2012 10:02 PM, self.python wrote: it's a finder using threading to accelerate Threading with Python does not accelerate unless all but one of the treads are i/o bound. You need multiple processes to use multiple cores in parallel. -- Terry Jan Reedy -- http://mail.pytho

Re: Tkinter.event.widget: handler gets name instead of widget.

2012-07-09 Thread Terry Reedy
On 7/9/2012 1:49 PM, Rick Johnson wrote: On Jul 9, 12:58 am, Terry Reedy wrote: When posting problem code, you should post a minimal, self-contained example that people can try on other systems and versions. Can you create the problem with one record, which you could give, and one binding? Do

Re: lambda in list comprehension acting funny

2012-07-11 Thread Terry Reedy
ogling gives me no clue. 4th hit: Arithmetic Logic Unit (hardware) -- Wikipedia ALU class -- software version or simulation thereof. The hardware version of Dennis's distributed design would be interesting. Spreadsheets are based in part on the same idea of distributed logic and arithm

Re: code review

2012-07-13 Thread Terry Reedy
rators in the usual sense because of short-circuiting. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter.event.widget: handler gets name instead of widget.

2012-07-13 Thread Terry Reedy
prerequisites for other modules). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: code review

2012-07-14 Thread Terry Reedy
On 7/14/2012 5:26 AM, Ian Kelly wrote: On Fri, Jul 13, 2012 at 5:09 PM, Terry Reedy wrote: I believe the following rule is true: if a op b is True or False raises, Sorry, left out 'or' in 'or raises' I don't follow. Raises what? an Exception. then op

Re: lambda in list comprehension acting funny

2012-07-15 Thread Terry Reedy
expressions are resolved at call time. and d) people more often forget c) when thinking about lambda expressions that for def statements. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Terry Reedy
her to change the current behavior was discussed on python-ideas a couple of months ago. I believe inertia and back-compatibity and the rare use case won. > reinforces the point that if you only want to test whether you have > None, you should use "is not None" rather than relying

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Terry Reedy
ense, but any other value would not). Should I? If you only want to execute the if branch when x is literally the bool object True and x could be some other non-bool true value such as 1 or 'a' or [1], etc, then you should. If x is guaranteed to be True or False, which is the case you

Re: Style question: metaclass self vs cls?

2012-07-16 Thread Terry Reedy
def __new__(meta, *args): ... def method(cls, *args): ... class Example(metaclass=ExampleMeta): def another_method(self): ... What do others do? Not too many people write real metaclasses. Python lets you chose. Have you looked at the C code of type? (Not that you are bound by it.) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Terry Reedy
n runtime errors however they occur and if I can leave it to the compiler to check as much as possible then I'll take that. import ast a = ast.literal_eval(input('enter a value: ')) b = ast.literal_eval(input('enter a comparable value: ') try: print('th

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Terry Reedy
With some inefficient redundancy, I believe it could be done in one line in Python. Better code would take a few more. In bash this is laughably trivial sort -nr $1 | head -${2:-10} Won't sort work alphabetically and leave the following as is? 1\talpha 11\tbeta 2\tgamma -- Terry Jan R

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Terry Reedy
o any of them have a premade 3.3.0b0 available? (In some ways, it is already better than 3.2.3.) -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit conversion to boolean in if and while statements

2012-07-17 Thread Terry Reedy
of undefined_names other that assignments do. The actually execution order is expression first, then if. You can explicitly test "'some_name' in namespace" or "hasattr(obj, 'somename') by turning the possibly undefined name into a string object. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: assertraises behaviour

2012-07-17 Thread Terry Reedy
dependent unless you take steps to make them independent by not having them raise exceptions or by catching exception as you go until you are done. If you make a error_list of problems as you go, you could end the method with assertFalse(error_list). -- Terry Jan Reedy -- http://mail.python.

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Terry Reedy
an __index__ method, so that it can be used as a sequence index) and that its value is >= 0. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPy, is it a 1:1 replacement for CPython?

2012-07-21 Thread Terry Reedy
On 7/20/2012 11:52 PM, Alec Taylor wrote: ask on PyPy's list But yes, it is designed as a 1:1 replacement of CPython It is a replacement for some late 2.x versions but not, at present, for Python 3. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: the meaning of r’.......‘

2012-07-23 Thread Terry Reedy
raw (string literal) and NOT as (raw string) literal. I know that the docs sometimes leave off 'literal', but that sometimes confuses people that there is such a thing as a raw string instance. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: can someone teach me this?

2012-07-23 Thread Terry Reedy
. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Gender, Representativeness and Reputation in StackOverflow

2012-07-23 Thread Terry Reedy
reely donated time. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Gender, Representativeness and Reputation in StackOverflow

2012-07-23 Thread Terry Reedy
he side where I missed it. http://www.win.tue.nl/~aserebre/MSR2012.pdf for anyone interested. So I withdraw the corresponding parts of my comment. Of course, A.S. could have just posted it instead of or in addition to the indirect link. Now that I look at it, I agree with the intent. --

Re: no data exclution and unique combination.

2012-07-24 Thread Terry Reedy
=[1,2,3,5,4,4,1,3,2,1,3,4] no_data_a=1 no_data_b=2 a_clean=(4,4,5,4,4,2,4) b_clean=(3,5,4,4,3,3,4) cleaned = list(zip(*(pair for pair in zip(a,b) if pair[0] != no_data_a and pair[1] != no_data_b))) print(cleaned, cleaned == [a_clean, b_clean]) # [(4, 4, 5, 4, 4, 2, 4), (3, 5, 4, 4, 3, 3, 4)] True -- Terry Jan

Re: HMM and CRF Package

2012-07-25 Thread Terry Reedy
can only use code that works with x.y ;=). However, any Python process can use any other program via the subprocess module. You just have to work out the data transfer. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: append in IMAP4 from imaplib very slow

2012-07-26 Thread Terry Reedy
LAY=1: 0.0027711391449 seconds This is a huge difference. Setting TCP_NODELAY=1 will bring the runtime from 3:30 minutes down to 14 seconds! Not Perl speed, but close. Do you think this warrants a change in our docs, if not the code? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: from future import pass_function

2012-07-26 Thread Terry Reedy
proceedures, and that is not going to change, especially for a null proceedure. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating valid identifiers

2012-07-26 Thread Terry Reedy
. It would increase SQL parsing time and don't look good. Let's just say that the limit should be 32 characters. If I controlled all the component names, I would try to limit their lengths so that the sum of lengths was limited to the limit. -- Terry Jan Reedy -- http://mail.

Re: from future import pass_function

2012-07-26 Thread Terry Reedy
me as return None in this context A function needs a lot more meat than that to be added as a builtin. --- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Search and replace text in XML file?

2012-07-28 Thread Terry Reedy
processor. Such things often make changes of various sorts. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a commercial proposition ?

2012-07-29 Thread Terry Reedy
es coded in C. The first 'killer app' for Python, in the 1990s, was its use as a glue language for interactive and batch scientific/numerical computation mostly done in compiled Fortran. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting bit fields from an IEEE-784 float

2012-07-29 Thread Terry Reedy
g. 2) If the platform byte-order is reversed, do I need to take any special action? I don't think I do, because even though the float is reversed, so will be the bit mask. Is this correct? The math modules functions to disassemble floats will not care. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError vs AttributeError

2012-07-31 Thread Terry Reedy
but not possibly both. In the rare cases when one wants to catch both errors, one can easily enough. To continue the example above, popping an empty list and empty set produce IndexError and KeyError respectively: try: while True: process(pop()) except (KeyError, IndexError)

Why 'Flat is better than nested'

2012-07-31 Thread Terry Reedy
as (about) 2*N - log2(N) parent child relationships. In other words, nearly quadruple the number of entities to learn, discuss, and remember. Well, there had better be a good necessity to do so ;-). And, of course, once new entities *are* conjured up, it is hard to get rid of them. -- Terr

Re: Why 'Flat is better than nested'

2012-07-31 Thread Terry Reedy
node could have an indefinite number of ancestors. from https://en.wikipedia.org/wiki/Binary_tree "A full binary tree (sometimes proper binary tree or 2-tree or strictly binary tree) is a tree in which every node other than the leaves has two children." -- Terry Jan R

Re: NameError vs AttributeError

2012-07-31 Thread Terry Reedy
On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy mailto:tjre...@udel.edu>> wrote: Another example: KeyError and IndexError are both subscript errors, but there is no SubscriptError superclass, even though both work thru the same mec

Re: why the different output in Eclipse and Python Shell?

2012-07-31 Thread Terry Reedy
t line. It is not relevant to your question. dict.fromkeys(['China','America']) output:{'America': None, 'China': None} The interactive interpreter echoes the result of evaluating expressions. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError vs AttributeError

2012-08-01 Thread Terry Reedy
On 8/1/2012 11:53 AM, Ethan Furman wrote: Terry Reedy wrote: On 7/31/2012 4:49 PM, Chris Kaynor wrote: On Tue, Jul 31, 2012 at 1:21 PM, Terry Reedy wrote: one wants to catch both errors, one can easily enough. To continue the example above, popping an empty list and empty set produce

Re: EXTERNAL: Re: missing python-config and building python on Windows

2012-08-01 Thread Terry Reedy
ndows installer is a .msi file created by a script that uses msilib. I don't know whether that script is in the repository. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Deciding inheritance at instantiation?

2012-08-03 Thread Terry Reedy
nt) for dynamic class creation. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: when an iterable object is exhausted or not

2012-08-04 Thread Terry Reedy
) to produce a filter object that produced filteriterators, the latter would often only work for the first. Also, If you want the filtered collection more than once, you should just save it. On the other hand, reproducing counts with a rangeiterator is nearly as fast as looking them up in a saved list, and much more memory efficient. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-05 Thread Terry Reedy
ent files lists. I use it for short shippets that are two long to directly type into the shell. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: I thought I understood how import worked...

2012-08-07 Thread Terry Reedy
ce as such postings rather that go look to find out the context. However, this one is wrong on its own ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: I thought I understood how import worked...

2012-08-07 Thread Terry Reedy
documentation bug http://bugs.python.org/> describing this? Sure, once I understand how it's really supposed to work :-) You don't need a final solution to file. Anyway, I think the change above might be enough. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Procedure to request adding a module to the standard library - or initiating a vote on it

2012-08-07 Thread Terry Reedy
s list (which Guido reads even if he does not write much). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a good introduction to object oriented programming with Python

2012-08-07 Thread Terry Reedy
and deconstruct. Python iterator embody the the same principle. next(iterator) = iterator: return one item and mutate yourself to represent the rest -- or raise StopIteration. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread Terry Reedy
improved a bit and opened an issue to "Improve socketserver doc" http://bugs.python.org/issue15608 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a clever way to pass arguments

2012-08-09 Thread Terry Reedy
a lot of parameters). He can't change the function definition. One can always wrap a function with an adaptor if the signature is too awful. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: no data exclution and unique combination.

2012-08-09 Thread Terry Reedy
On 8/9/2012 4:06 PM, giuseppe.amatu...@gmail.com wrote: Terry and MRAB, thanks for yours suggestions, in the end i found this solution mask=( a != 0 ) & ( b != 0 ) a_mask=a[mask] b_mask=b[mask] array2D = np.array(zip(a_mask,b_mask)) unique=dict() for row in array2D : row = tuple

Re: save dictionary to a file without brackets.

2012-08-09 Thread Terry Reedy
n. In 3.x, .keys, .values, and .items are set-like read-only views specifically designed for iteration. So in 3.x they are THE way to do so for whichever alternative is appropriate. Iterating by keys and then looking up values instead of yielding the values at the same time is ext

Re: Keep getting this in PyDev "TypeError: quiz() takes exactly 1 argument (0 given)"

2012-08-10 Thread Terry Reedy
ment, *before* the class is created. Rather unusual ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Arithmetic with Boolean values

2012-08-11 Thread Terry Reedy
) % 2)) == 1 + (not len(L) % 2) Works just fine with parentheses to enforce the correct interpretation. This also works in Python 3.2, fwiw (except that you need list(range(5)) to create the sample list). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Idle no longer works

2012-08-11 Thread Terry Reedy
s damaged. Easiest fix is to uninstall and re-install Python. But download a more recent version first. Uninstall might not be needed, but makes process more like to work. In the regular interactive command prompt interpreter import idlelib.idle should start idle. -- Terry Jan Reed

Re: in-place exponentiation incongruities

2012-08-12 Thread Terry Reedy
t true. Whether the function is coded in Python or C cls.__ipow__(base, exp, mod) # or base.__ipow__(exp, mod) while he would be able to call the normal version with the third argument. That can also be done directly >>> int.__pow__(5, 3, 4) 1 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Official reason for omitting inspect.currentcallable() ?

2012-08-12 Thread Terry Reedy
ther the original author or not, wraps the function (say to log calls), then the function continues to work with the wrapped version. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Idle no longer works

2012-08-13 Thread Terry Reedy
nw.exe) {Just booted the Win7 laptop with Python 2.7.x: The only real difference is that it uses Python.File where the above has py_auto_file} Re-installing, as I suggested in the first response, is much easier, especially for someone not familiar with the above. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange behavior

2012-08-14 Thread Terry Reedy
original, as k removals from len n list is O(k*n) versus O(n) for new list and copy. P/S: str is a builtin, you'd better avoid assigning to it. Agreed. People have actually posted code doing something like ... list = [1,2,3] ... z = list(x) ... and wondered and asked why it does not work. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Monty Python in Syria

2012-08-15 Thread Terry Reedy
ng something OT does not excuse it. It should still be related. We cannot allow 1000s of OT posts a day, marked OT or not. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

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