MAJOR CANADIAN CHRISTIAN MISSIONARY CONVERTS TO ISLAM !!!!!!!!!!!!!!
MAJOR CANADIAN CHRISTIAN MISSIONARY CONVERTS TO ISLAM By: Dr Garry Miller: A very important Christian missionary converted to Islam and became a major herald for Islam, he was a very active missionary and was very knowledgeable about the Bible... This man likes mathematics so much, that's why he likes logic. One day, he decided to read the Quran to try to find any mistakes that he might take advantage of while inviting Muslims to convert to Christianity He expected the Koran to be an old book written 14 centuries ago, a book that talks about the desert and so on...He was amazed from what he found. He discovered that this Book had what no other book in the world has He expected to find some stories about the hard time that the Prophet Mohammad (Peace Be Upon Him) had, like the death of his wife Khadijah (may Allah be pleased with her) or the death of his sons and daughters...however, he did not find anything like that... and what made him even more confused is that he found a full sura(chapter) in the Koran named Mary that contains a lot of respect to Mary(peace be upon her) which is not the case even in the books written by Christians nor in their bibles. He did not find a Sura named after Fatimah(the prophet's daughter) nor Aa’ishah(the Prophet's wife), may Allah(God) be pleased with both of them. He also found that the name of Jesus(Peace Be Upon Him) was mentioned in the Koran 25 times while the name of Mohammed(Peace Be Upon Him) was mentioned only 4 times, so he became more confused. He started reading the Koran more thoroughly hoping to find a mistake but he was shocked when he read a great verse which is verse number 82 in Surat Al-Nisa'(Women) that says: “Do they not consider the Koran (with care)? Had it been from other than Allah, they would surely have found therein much discrepancy”. Dr Miller says about this verse: “ One of the well known scientific principles is the principle of finding mistakes or looking for mistakes in a theory until it’s proved to be right (Falsification Test) …what’s amazing is that the Holy Quran asks Muslims and non-muslims to try to find mistakes in this book and it tells them that they will never find any”. He also says about this verse: no writer in the world has the courage to write a book and say that it’s empty of mistakes, but the Quran, on the contrary, tells you that it has no mistakes and asks you to try to find one and you won’t find any. Another verse that Dr Miller reflected on for a long time is the verse number 30 in Surat “Al-Anbiya’”(The Prophets): “ Do not the Unbelievers see that the heavens and the earth were joined together (as one unit of Creation), before We clove them asunder? We made from water every living thing. Will they not then believe?” He says: “ This verse is exactly the subject of the scientific research that won the Noble prize in 1973 and was about the theory of the “Great Explosion”. According to this theory, the universe was the result of a great explosion that leads to the formation of the universe with its skies and planets”. Dr Miller says: “ Now we come to what’s amazing about the Prophet Mohammed (PBUH) and what’s pretended about the devils helping him, God says: “No evil ones have brought down this (Revelation), it would neither suit them nor would they be able (to produce it). Indeed they have been removed far from even (a chance of) hearing it” (26:210-212). “When thou do read the Quran, seek Allah's protection from Satan the Rejected One” (16:98). You see? can this be the devil’s way to write a book? how can he write a book then tells you to ask God for protection from this devil before reading that book? those are miraculous verses in this miraculous book! and has a logical answer to those who pretend that it’s from the devil”. And among the stories that amazed Dr Miller is the story of the Prophet (PBUH) with Abu-Lahab… Dr Miller says: “ This man (Abu Lahab) used to hate Islam so much that he would go after the Prophet wherever he goes to humiliate him. If he saw the prophet talking to strangers, he used to wait till he finishes and then ask them: what did Mohammed tell you? If he said it’s white then it’s in reality black and if he said it’s night then it’s day. He meant to falsify all what the prophet says and to make people suspicious about it. And 10 years before the death of Abu Lahab, a sura was inspired to the prophet, named “Al-Masad”. This sura tells that Abu Lahab will go to hell, in other words, it says that Abu Lahab will not convert to Islam. During 10 years, Abu Lahab could have said: “Mohammed is saying that I will not become a Muslim and that I will go to the hell fire, but I’m telling you now that I want to convert to Islam and become a Muslim. What do you think about Mohammed now? Is he saying the truth or no? Does his inspiration come from God?” But Abu Lahab did not do that at all although he was disobeying the prophet in all matters, but not in this one. In other words, it was as if
Re: namespace question
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: The preferred terms in Python circles are class and instance *attributes*, not variables. Yes, full ACK. An integer variable is a variable holding an integer. A string variable is a variable holding a string. A list variable is a variable holding a list. And Python has none of those. Its references don't “hold” anything. I appreciate that you think “variable” is a useful term in Python, but this kind of mangling of the concept convinces me that it's not worth it. Python doesn't have variables, and even if you want to say “variables” when you mean “references”, there's no such thing as a “string variable” etc. in Python. References don't have types, so its needlessly confusing to perpetuate that kind of thinking. Other languages may choose to use illogical terminology if they choose. Whereas we are not beholden to it, so let's avoid it where feasible, and help newcomers to do so. -- \ “There is no reason anyone would want a computer in their | `\ home.” —Ken Olson, president, chairman and founder of Digital | _o__)Equipment Corp., 1977 | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3
Benjamin Peterson benja...@python.org writes: We're pleased to announce the immediate availability of release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3 . If you're pleased to announce their immediate availability, then please do that! Putting “RELEASED” in the subject, when they're not released and are instead *candidates for* release, is confusing and muddies the issue of what you even mean by “release”. -- \ “Give a man a fish, and you'll feed him for a day; give him a | `\religion, and he'll starve to death while praying for a fish.” | _o__) —Anonymous | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3
On Sun, Feb 26, 2012 at 7:51 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Benjamin Peterson benja...@python.org writes: We're pleased to announce the immediate availability of release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3 . If you're pleased to announce their immediate availability, then please do that! Isn't it perfectly accurate to say that the RCs are now available? Considering that Release candidates immediately followed RELEASED in the subject line, I don't see any confusion. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
MAJOR CANADIAN CHRISTIAN MISSIONARY CONVERTS TO ISLAM !!!!!!!!!!!!!!
MAJOR CANADIAN CHRISTIAN MISSIONARY CONVERTS TO ISLAM By: Dr Garry Miller: A very important Christian missionary converted to Islam and became a major herald for Islam, he was a very active missionary and was very knowledgeable about the Bible... This man likes mathematics so much, that's why he likes logic. One day, he decided to read the Quran to try to find any mistakes that he might take advantage of while inviting Muslims to convert to Christianity He expected the Koran to be an old book written 14 centuries ago, a book that talks about the desert and so on...He was amazed from what he found. He discovered that this Book had what no other book in the world has He expected to find some stories about the hard time that the Prophet Mohammad (Peace Be Upon Him) had, like the death of his wife Khadijah (may Allah be pleased with her) or the death of his sons and daughters...however, he did not find anything like that... and what made him even more confused is that he found a full sura(chapter) in the Koran named Mary that contains a lot of respect to Mary(peace be upon her) which is not the case even in the books written by Christians nor in their bibles. He did not find a Sura named after Fatimah(the prophet's daughter) nor Aa’ishah(the Prophet's wife), may Allah(God) be pleased with both of them. He also found that the name of Jesus(Peace Be Upon Him) was mentioned in the Koran 25 times while the name of Mohammed(Peace Be Upon Him) was mentioned only 4 times, so he became more confused. He started reading the Koran more thoroughly hoping to find a mistake but he was shocked when he read a great verse which is verse number 82 in Surat Al-Nisa'(Women) that says: “Do they not consider the Koran (with care)? Had it been from other than Allah, they would surely have found therein much discrepancy”. Dr Miller says about this verse: “ One of the well known scientific principles is the principle of finding mistakes or looking for mistakes in a theory until it’s proved to be right (Falsification Test) …what’s amazing is that the Holy Quran asks Muslims and non-muslims to try to find mistakes in this book and it tells them that they will never find any”. He also says about this verse: no writer in the world has the courage to write a book and say that it’s empty of mistakes, but the Quran, on the contrary, tells you that it has no mistakes and asks you to try to find one and you won’t find any. Another verse that Dr Miller reflected on for a long time is the verse number 30 in Surat “Al-Anbiya’”(The Prophets): “ Do not the Unbelievers see that the heavens and the earth were joined together (as one unit of Creation), before We clove them asunder? We made from water every living thing. Will they not then believe?” He says: “ This verse is exactly the subject of the scientific research that won the Noble prize in 1973 and was about the theory of the “Great Explosion”. According to this theory, the universe was the result of a great explosion that leads to the formation of the universe with its skies and planets”. Dr Miller says: “ Now we come to what’s amazing about the Prophet Mohammed (PBUH) and what’s pretended about the devils helping him, God says: “No evil ones have brought down this (Revelation), it would neither suit them nor would they be able (to produce it). Indeed they have been removed far from even (a chance of) hearing it” (26:210-212). “When thou do read the Quran, seek Allah's protection from Satan the Rejected One” (16:98). You see? can this be the devil’s way to write a book? how can he write a book then tells you to ask God for protection from this devil before reading that book? those are miraculous verses in this miraculous book! and has a logical answer to those who pretend that it’s from the devil”. And among the stories that amazed Dr Miller is the story of the Prophet (PBUH) with Abu-Lahab… Dr Miller says: “ This man (Abu Lahab) used to hate Islam so much that he would go after the Prophet wherever he goes to humiliate him. If he saw the prophet talking to strangers, he used to wait till he finishes and then ask them: what did Mohammed tell you? If he said it’s white then it’s in reality black and if he said it’s night then it’s day. He meant to falsify all what the prophet says and to make people suspicious about it. And 10 years before the death of Abu Lahab, a sura was inspired to the prophet, named “Al-Masad”. This sura tells that Abu Lahab will go to hell, in other words, it says that Abu Lahab will not convert to Islam. During 10 years, Abu Lahab could have said: “Mohammed is saying that I will not become a Muslim and that I will go to the hell fire, but I’m telling you now that I want to convert to Islam and become a Muslim. What do you think about Mohammed now? Is he saying the truth or no? Does his inspiration come from God?” But Abu Lahab did not do that at all although he was disobeying the prophet in all matters, but not in this one. In other words, it was as if
Re: Python math is off by .000000000000045
On 25 fév, 23:51, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sat, 25 Feb 2012 13:25:37 -0800, jmfauth wrote: (2.0).hex() '0x1.0p+1' (4.0).hex() '0x1.0p+2' (1.5).hex() '0x1.8p+0' (1.1).hex() '0x1.1999ap+0' jmf What's your point? I'm afraid my crystal ball is out of order and I have no idea whether you have a question or are just demonstrating your mastery of copy and paste from the Python interactive interpreter. It should be enough to indicate the right direction for casual interested readers. -- http://mail.python.org/mailman/listinfo/python-list
Question about circular imports
Hi all I seem to have a recurring battle with circular imports, and I am trying to nail it once and for all. Let me say at the outset that I don't think I can get rid of circular imports altogether. It is not uncommon for me to find that a method in Module A needs to access something in Module B, and a method in Module B needs to access something in Module A. I know that the standard advice is to reorganise the code to avoid this, and I try to do this where possible, but for now I would like to address the question of how to handle the situation if this is otherwise unavoidable. The problem is clearly explained in the Python Programming FAQ - Circular imports are fine where both modules use the import module form of import. They fail when the 2nd module wants to grab a name out of the first (from module import name) and the import is at the top level. That's because names in the 1st are not yet available, because the first module is busy importing the 2nd. Having recently reorganised my code into packages, I find that the same problem arises with packages. Assume the following structure, copied from the Tutorial - sound/ __init__.py formats/ __init__.py wavread.py wavwrite.py The following fails - in wavread.py - from formats import wavwrite [this works] in wavwrite.py - from formats import wavread [this fails with ImportError] I can think of two solutions - one is cumbersome, the other may not be good practice. The first solution is - in wavread.py - import formats.wavwrite in wavwrite.py - import formats.wavread I then have to use the full path to reference any attribute inside the imported module, which I find cumbersome. The second solution is - in formats/__init__.py import sys sys.path.insert(0, __path__[0]) in wavread.py - import wavwrite in wavwrite.py - import wavread This works, but I don't know if it is a good idea to add all the sub-package paths to sys.path. I realise that it is up to me to avoid any name clashes. Are there any other downsides? So I guess my question is - - is there a better solution to my problem? - if not, is my second solution acceptable? If not, I seem to be stuck with using full path names to reference any attributes in imported modules. I am using Python3 exclusively now, if that makes any difference. Any advice will be appreciated. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about circular imports
Frank Millman wrote: I seem to have a recurring battle with circular imports, and I am trying to nail it once and for all. Let me say at the outset that I don't think I can get rid of circular imports altogether. It is not uncommon for me to find that a method in Module A needs to access something in Module B, and a method in Module B needs to access something in Module A. I know that the standard advice is to reorganise the code to avoid this, and I try to do this where possible, but for now I would like to address the question of how to handle the situation if this is otherwise unavoidable. To cut a long story short, why should circular imports be unavoidable? The problem is clearly explained in the Python Programming FAQ - Circular imports are fine where both modules use the import module form of import. They fail when the 2nd module wants to grab a name out of the first (from module import name) and the import is at the top level. That's because names in the 1st are not yet available, because the first module is busy importing the 2nd. Having recently reorganised my code into packages, I find that the same problem arises with packages. Assume the following structure, copied from the Tutorial - sound/ __init__.py formats/ __init__.py wavread.py wavwrite.py The following fails - in wavread.py - from formats import wavwrite [this works] in wavwrite.py - from formats import wavread [this fails with ImportError] I can think of two solutions - one is cumbersome, the other may not be good practice. The first solution is - in wavread.py - import formats.wavwrite in wavwrite.py - import formats.wavread This should be import sound.formats.wavread I then have to use the full path to reference any attribute inside the imported module, which I find cumbersome. The second solution is - in formats/__init__.py import sys sys.path.insert(0, __path__[0]) in wavread.py - import wavwrite in wavwrite.py - import wavread This works, but I don't know if it is a good idea to add all the sub-package paths to sys.path. I realise that it is up to me to avoid any name clashes. Are there any other downsides? So I guess my question is - - is there a better solution to my problem? - if not, is my second solution acceptable? Paths into packages are recipe for desaster. You may end up with multiple instances of the same module and your programs will break in interesting (hard to debug) ways. If not, I seem to be stuck with using full path names to reference any attributes in imported modules. I am using Python3 exclusively now, if that makes any difference. Any advice will be appreciated. Frank Millman -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about circular imports
Frank Millman fr...@chagford.com wrote in message news:jid2a9$n21$1...@dough.gmane.org... Hi all I seem to have a recurring battle with circular imports, and I am trying to nail it once and for all. [...] The second solution is - in formats/__init__.py import sys sys.path.insert(0, __path__[0]) in wavread.py - import wavwrite in wavwrite.py - import wavread This works, but I don't know if it is a good idea to add all the sub-package paths to sys.path. I realise that it is up to me to avoid any name clashes. Are there any other downsides? Answering my own question, I have just found a downside that is a showstopper. If a module in a different sub-package needs to import one of these modules, it must use a full path. This results in a new entry in sys.modules, and therefore any attributes referenced by the intra-package module have different identities from those referenced from outside. If they are static, there is no problem, but if not, disaster strikes! Frank -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about circular imports
Peter Otten __pete...@web.de wrote in message news:jid424$vfp$1...@dough.gmane.org... Frank Millman wrote: To cut a long story short, why should circular imports be unavoidable? Paths into packages are recipe for desaster. You may end up with multiple instances of the same module and your programs will break in interesting (hard to debug) ways. Thanks, Peter. I have just figured this out for myself, but you beat me to it. Full paths it is, then. Frank -- http://mail.python.org/mailman/listinfo/python-list
Re: generate Windows exe on Linux
In article mailman.55.1329949521.3037.python-l...@python.org, Gelonida N gelon...@gmail.com wrote: On 02/22/2012 07:05 PM, Alec Taylor wrote: http://www.pyinstaller.org/ or http://cx-freeze.sourceforge.net/ You can also run py2exe in WINE You want to say, that I could install python 2.6 some packages like win32api PyQt and tand py2exe under Wine and then compile it. Did you try this? I didn't even think about trying this out, but I know very little about the limits of Wine, so perhaps I underestimate it. As a case in point I have this example of another language: colorforth. It was made by a genius inventor (Chuck Moore), and only runs from a boot-floppy and writes pixels to the screen. Someone made an environment in MS-Windows to emulate the booting process and all. This actually runs colorforth. Now about Wine, how good is it? Actually it is good enough to run the above emulator! (We run a third emulator, of the GA144, on top at a decent speed.) Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spearc.xs4all.nl =n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
In article c52c1114-647a-4887-926b-8856c939f...@b23g2000yqn.googlegroups.com, Rick Johnson rantingrickjohn...@gmail.com wrote: On Feb 18, 1:28=A0am, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Feb 17, 2012 at 6:13 PM, Rick Johnson If I were to [sum my tax burden], it would probably come to around 30%, which still doesn't bother me, in part because I know that it comes back to benefit the society I live in, and by extension me, in one way or another.. But do you think you'll get a higher return for your investment? Is it possible to get a higher return on your investment in this type of system? NO! You better off just paying for your own damn healthcare. Well actually, there is a way to get a higher return by taking more than your fair share. Any intelligent person would realize that public healthcare is advocated by degenerates or the bleeding heart degenerate eugenics supporters. Fine, YOU want to subsidize degeneracy? Then give to charity. The more you give the better you'll feel. BTW: How much money do you give to charity? This is technically wrong. It is much cheaper for you to pay a few euro's to combat TBC, then live in a TBC-infected society where you must take great care not to be infected yourself. Paying to rid the society of TBC is not charity, it is is common sense. Your ideas only work for the anti-social few, in an otherwise social society. Education is another case in point. It is in you best interest to allow a getto-genius into Harvard. Otherwise they will become the master-minds of crime. And you will be too stupid to beat them. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spearc.xs4all.nl =n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list
Re: pickle handling multiple objects ..
On Sun, Feb 26, 2012 at 3:25 AM, Smiley 4321 ssmil...@gmail.com wrote: If I have a sample python code to be executed on Linux. How should I handle multiple objects with 'pickle' as below - --- #!/usr/bin/python import pickle #my_list = {'a': 'Apple', 'b': 'Mango', 'c': 'Orange', 'd': 'Pineapple'} #my_list = ('Apple', 'Mango', 'Orange', 'Pineapple') my_list = ['Apple', 'Mango', 'Orange', 'Pineapple'] #my_list = () output = open('readfile.pkl', 'wb') pickle.dump(my_list, output) output.close() my_file = open('readfile.pkl', 'rb') my_list2 = pickle.load(my_file) my_file.close() print my_list print my_list2 - This code works fine but now I have to handle multiple objects? You can either nest the multiple objects inside a single compound object and just (un)pickle that, or you call call dump()/load() repeatedly (once per object; yes, this works). Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
Am 25.02.12 18:54, schrieb MRAB: If there is no limit for len(string), why not simply use # get_limit() returns None if there is no limit maxlength = get_limit() if maxlength and (len(string)= maxlength): allow_passage() else: deny_passage() That should be: if maxlength is not None and len(string) = maxlength: Take a look at http://docs.python.org/library/stdtypes.html where you can read: = Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below. The following values are considered false: None False zero of any numeric type, for example, 0, 0L, 0.0, 0j. any empty sequence, for example, '', (), []. any empty mapping, for example, {}. instances of user-defined classes, if the class defines __nonzero__() or __len__() method, when that method returns the integer zero or bool value False. [1] All other values are considered true — so objects of many types are always true. == That means: if maxlength and (len(string) = maxlength): is equivalent to if (maxlength is not None) and (len(string) = maxlength): which is more complicated to type and -in my opinion- not so intuitive. But because it is equivalent, it is a matter of taste, what to use. Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: pickle handling multiple objects ..
Smiley 4321 wrote: If I have a sample python code to be executed on Linux. How should I handle multiple objects with 'pickle' as below - --- #!/usr/bin/python import pickle #my_list = {'a': 'Apple', 'b': 'Mango', 'c': 'Orange', 'd': 'Pineapple'} #my_list = ('Apple', 'Mango', 'Orange', 'Pineapple') my_list = ['Apple', 'Mango', 'Orange', 'Pineapple'] #my_list = () output = open('readfile.pkl', 'wb') pickle.dump(my_list, output) output.close() my_file = open('readfile.pkl', 'rb') my_list2 = pickle.load(my_file) my_file.close() print my_list print my_list2 - This code works fine but now I have to handle multiple objects? You never do that with pickle. You pack your data into a single object before you store it, and unpack it after loading it. Here's an example using a tuple as the container: fruit = [apple, orange] vegetables = [potato, tomato] beverages = [milk, coffee, water] with open(tmp.pickle, wb) as f: pickle.dump((fruit, vegetables, beverages), f) with open(tmp.pickle, rb) as f: fruit, vegetables, beverages = pickle.load(f) print fruit print vegetables print beverages This is however a bit errorprone. If you accidentally write the loading code as fruit, beverages, vegetables = pickle.load(f) you'll end up drinking potatoes. A better container would be a dict. Something like pickle.dump(dict(fruit=fruit, vegetables=vegetables, beverages=beverages), f) ... data = pickle.load(f) fruit = data[fruit] beverages = data[beverages] vegetables = data[vegetables] is harder to get wrong. It is also easier to extend. Code that only reads the pickle will happily ignore extra keys in the dictionary. If you follow that path somewhat more you will probably drop the lowlevel pickle and use a key-value store like Python's shelve instead, see http://docs.python.org/library/shelve.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3
Chris Angelico ros...@gmail.com writes: On Sun, Feb 26, 2012 at 7:51 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: If you're pleased to announce their immediate availability, then please do that! Isn't it perfectly accurate to say that the RCs are now available? Yes. What's not reasonable is to say that a candidate for release – i.e. something *prior to* release, by definition – is nevertheless released. Considering that Release candidates immediately followed RELEASED in the subject line, I don't see any confusion. Unless “release candidate” means nothing like what those words imply, it can't be both a release candidate *and* released. Either it's released, or it's not. If it's a release candidate, it's not released yet. If it's released, it's no longer a candidate for release. Saying it's simultaneously both is the confusion. -- \ “The Things to do are: the things that need doing, that you see | `\ need to be done, and that no one else seems to see need to be | _o__) done.” —Richard Buckminster Fuller, 1970-02-16 | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
In article 40af8461-1583-4496-9d81-d52d6905d...@b23g2000yqn.googlegroups.com, Rick Johnson rantingrickjohn...@gmail.com wrote: Because the Jews allowed themselves to be subjected. Sad, but true. Actually Jew stands for (relative) coward. Let me explain. Jew comes from Juda, one of the 12 tribes. At some time Israel was subjected and 11 tribes resisted to the death and are eradicated since. Only the Juda tribe gave in and their land was called Judea since. (So the name Israel for the current state is a propagandistic lie, to claim the land once occupied by the 12 tribes.) I don't blame them for the attitude of live to fight another day or even for plain survival. If the Jews hadn't allow themselves to be subjected, there would be no Jews. Slaves only exist because they allow themselves to exist. When people Never been a slave, were you? Try to imagine what it is to be born a slave. Freedmmm! Live free, or die! From my cold dead hand! Over my dead body! Freedom is never voluntarily given by the oppressor; it must be demanded by the oppressed. Those who deny freedom to others deserve it not for themselves. Man is free at the moment he wishes to be. Those who desire to give up freedom in order to gain security, will not have, nor do they deserve, either one. Black Panther comes to mind. The USA just killed them. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spearc.xs4all.nl =n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Sun, Feb 26, 2012 at 10:56 PM, Wolfgang Meiners wolfgangmeiner...@web.de wrote: That means: if maxlength and (len(string) = maxlength): is equivalent to if (maxlength is not None) and (len(string) = maxlength): On the contrary, it means they are distinctly NOT equivalent. The shorter form would treat a maximum length of 0 as meaning unlimited. Now, that's an understandable notation, but it's not what's given here; if None means unlimited, then 0 should enforce that string == . ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: pickle handling multiple objects ..
On Sun, Feb 26, 2012 at 11:04 PM, Peter Otten __pete...@web.de wrote: This is however a bit errorprone. If you accidentally write the loading code as fruit, beverages, vegetables = pickle.load(f) you'll end up drinking potatoes. You mean vodka? :) Additionally, you'll get a weird crash out of your program if load() returns something other than a sequence of length 3. Remember, everything that comes from outside your code is untrusted, even if you think you made it just two seconds ago. Of course, sometimes that exception is absolutely correct. If you wrap all this in an exception handler that gives some reasonable behaviour - which might even be terminate the program with a traceback, which is the default - then it's fine to let it throw on failure, and anything else is just a waste of effort. But for maximum extensibility, you would want to make it so that you can add more elements to what you save without your code breaking on an old save file - and that's where the dictionary is far better. A slight tweak, though: data = pickle.load(f) fruit = data.get(fruit,[]) beverages = data.get(beverages,[]) vegetables = data.get(vegetables,[]) With this, you guarantee that (a) unrecognized keys will be safely ignored, and (b) absent keys will quietly go to their given defaults. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3
On Sun, Feb 26, 2012 at 11:21 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Unless “release candidate” means nothing like what those words imply, it can't be both a release candidate *and* released. Either it's released, or it's not. If it's a release candidate, it's not released yet. If it's released, it's no longer a candidate for release. Sure, fair enough. So what DO you do with an RC? Make it available? Seems a little verbose, but it's the best I can think of off-hand. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3
On Sun, 26 Feb 2012 23:21:07 +1100, Ben Finney wrote: Chris Angelico ros...@gmail.com writes: On Sun, Feb 26, 2012 at 7:51 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: If you're pleased to announce their immediate availability, then please do that! Isn't it perfectly accurate to say that the RCs are now available? Yes. What's not reasonable is to say that a candidate for release – i.e. something *prior to* release, by definition – is nevertheless released. We have a piece of software which has just been actively released to the public in a known fixed state, with a specific version number (2.6.8rc etc.). Since this active process of *releasing* software has occurred, the past tense [RELEASED] applies. What sort of software is it? Well, it's not a pre-alpha, or alpha, or beta version, nor is it the production-release version. It is a candidate to become the production-release, or Release candidate. Hence we have the release [verb] of a release candidate [compound noun]. There is no contradiction here, any more than it would be a contradiction to release a beta version. http://en.wikipedia.org/wiki/Software_release_life_cycle Considering that Release candidates immediately followed RELEASED in the subject line, I don't see any confusion. Unless “release candidate” means nothing like what those words imply, it can't be both a release candidate *and* released. What do you believe the words imply? I believe that they imply that the version is a candidate to be a production-ready release of the software, as opposed to a pre-alpha, alpha or beta version, but not yet the production-ready version. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
Am 25.02.12 21:35, schrieb Rick Johnson: On Feb 25, 11:54 am, MRAB pyt...@mrabarnett.plus.com wrote: [...] That should be: if maxlength is not None and len(string) = maxlength: Using imaginary infinity values defiles the intuitive nature of your code. What is more intuitive? def confine_length(string, maxlength=INFINITY): if string.length maxlength: do_something() def confine_length(string, maxlength=None): if maxlength is not None and len(string) = maxlength: do_something() I just had a closer look at it. It seems to be more complicated than i thougth: You will have to write def confine_length(string, maxlength=None): if maxlength: # maxlength exists, comparison possible if len(string) = maxlength: do_something() else: # maxlength does not exist, so always do something do_something() you migth also write def confine_length(str, maxlength=None): do_it = (len(str) = maxlength) if maxlength else True if do_it: do_something() but it really does not look intuitive. Hmm. My idea was that None is a perfect Value for infinity since there is no infinitely large number. But as i see it, you must have two comparisons then. Maybe someone has a better idea? Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Sun, 26 Feb 2012 12:56:46 +0100, Wolfgang Meiners wrote: That means: if maxlength and (len(string) = maxlength): is equivalent to if (maxlength is not None) and (len(string) = maxlength): which is more complicated to type and -in my opinion- not so intuitive. But because it is equivalent, it is a matter of taste, what to use. Incorrect. The two are *not* equivalent. def test(maxlength, string): flag1 = maxlength and (len(string) = maxlength) flag2 = (maxlength is not None) and (len(string) = maxlength) return bool(flag1), bool(flag2) # normalise to booleans test(0, '') (False, True) So the two forms will take opposite branches of the if statement when maxlength is 0 and string is the empty string. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
Am 26.02.12 13:52, schrieb Chris Angelico: On Sun, Feb 26, 2012 at 10:56 PM, Wolfgang Meiners wolfgangmeiner...@web.de wrote: That means: if maxlength and (len(string) = maxlength): is equivalent to if (maxlength is not None) and (len(string) = maxlength): On the contrary, it means they are distinctly NOT equivalent. The shorter form would treat a maximum length of 0 as meaning unlimited. Now, that's an understandable notation, but it's not what's given here; if None means unlimited, then 0 should enforce that string == . ChrisA You are right. It seems I did not get the line zero of any numeric type, for example, 0, 0L, 0.0, 0j. right. Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
Am 26.02.12 14:16, schrieb Wolfgang Meiners: I just had a closer look at it. It seems to be more complicated than i thougth: You will have to write Obviously not close enough, as i just learned. def confine_length(string, maxlength=None): if maxlength: # maxlength exists, comparison possible if maxlength is not None: # maxlength exists, comparison possible if len(string) = maxlength: do_something() else: # maxlength does not exist, so always do something do_something() you migth also write def confine_length(str, maxlength=None): do_it = (len(str) = maxlength) if maxlength else True do_it = (len(str) = maxlength) if maxlength is not None else True if do_it: do_something() I hope, it's correct now. Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On 26 February 2012 13:38, Wolfgang Meiners wolfgangmeiner...@web.de wrote: do_it = (len(str) = maxlength) if maxlength is not None else True That's a funny way to spell: do_it = maxlength is None or len(str) = maxlength -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list
Re: namespace question
On Sun, 26 Feb 2012 19:47:49 +1100, Ben Finney wrote: An integer variable is a variable holding an integer. A string variable is a variable holding a string. A list variable is a variable holding a list. And Python has none of those. Its references don't “hold” anything. Ah, but they do. Following the name binding: x = 1 the name x now holds a reference to an int, or if you want to cut out one layer of indirection, the name x holds an int. That is to say, the value associated with the name x is an int. I don't believe this is a troublesome concept. I appreciate that you think “variable” is a useful term in Python, but this kind of mangling of the concept convinces me that it's not worth it. I'm not sure that there is any mangling here. Or at least, the concept is only mangled if you believe that Pascal- or C-like variables (named memory locations) are the one true definition of variable. I do not believe this. Words vary in their meanings, pun not intended, and in the same way that the semantics of classes in (say) Java are not identical to the semantics of classes in Python, so I think that it is perfectly reasonable to talk about Python having variables, implemented using bindings to objects in a namespace, even though the semantics of Python variables is slightly different from that of C variables. Fundamentally, a variable is a name associated with a value which can vary. And Python name bindings meet that definition no less than C fixed memory locations. Python doesn't have variables, and even if you want to say “variables” when you mean “references”, there's no such thing as a “string variable” etc. in Python. References don't have types, so its needlessly confusing to perpetuate that kind of thinking. But objects have types, and it makes sense to state that the type of the name is the type of the object bound to that name, at least for the duration of the binding. That's exactly what we write in Python: type(x) tells us the type of x, whatever x happens to be. There's no implication that it is the type of the *name* x, since names are not typed. More importantly, while Python doesn't have static types, in real code, names generally are expected to be bound to objects of a particular type (perhaps a duck-type, but still a type). It is rare to have code including a name bound to *anything at all* -- the main counter-example I can think of is the id() function. Generally, names are expected to be bound to a specific kind of value: perhaps as specific as a string, or as general as an iterable, or anything with a __add__ method, but nevertheless there is the expectation that if the name is bound to something else, you will get an error. A compile time error in C, a runtime error in Python, but either way, the expectation is that you get an error. In an example like this: def spam(some_string): return some_string.upper() + ### I maintain that it is reasonable to say that some_string is a string variable, since that expresses the programmer's intention that some_string should be bound to string objects (modulo duck-typing). If Python were statically typed, then passing some_string=42 would cause a compile-time error. In Python, you get a runtime error instead. I don't believe this invalidates the idea that some_string is intended to be a string. Or to make this painfully complete: some_string is a name linked to a value which can vary (hence a variable) intended to be limited to strings (hence a string variable). Python may not enforce this to the same extent as C or Haskell or Pascal, but the concept still holds. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Sun, 26 Feb 2012 14:16:24 +0100, Wolfgang Meiners wrote: I just had a closer look at it. It seems to be more complicated than i thougth: You will have to write def confine_length(string, maxlength=None): if maxlength: # maxlength exists, comparison possible if len(string) = maxlength: do_something() else: # maxlength does not exist, so always do something do_something() No, that still takes the wrong branch for maxlength = 0. Be explicit in your code. If you want maxlength=None to be a sentinel for avoid the length test, then explicitly test for maxlength is None, don't be tempted to take short-cuts that can fail. def confine_length(string, maxlength=None): if maxlength is None: # no length comparison needed do_something() elif len(string) = maxlength: do_something() This can be simplified to: def confine_length(string, maxlength=None): if maxlength is None or len(string) = maxlength: do_something() Or even simpler: def confine_length(string, maxlength=float('inf')): if len(string) = maxlength: do_something() -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Software Engineer - Storage, Python, C++, Java
Blue Line Talent is looking for a mid-level software engineer with experience in a combination of Python, C/C++ and/or Java. Experience developing middleware is helpful. The Engineer will join an exciting start-up environment in a newly established location. This is an outstanding opportunity for a high performing software engineer with 3-5 years experience. Must love coding, variety. For this position most of the work is being done in Python now but they expect this SW Engineer will also use increasing amounts of C/C++ and Java. The languages experience isn't as important as finding a really sharp Software Engineer who loves programming (not just design) and would be well suited for the diversity of a start-up environment. Position Title: Software Engineer - Storage Work Location: Broomfield/Flatirons area, CO The Employer: • A strongly positioned Storage Solutions Software company • Fully funded and established start-up company with excellent opportunities for growth and advancement • Comprehensive benefits package Description: • Full life-cycle software design, development, implementation, test and maintenance. • Develop, test, and maintain infrastructure-oriented software in Python with some work in C/C++ and Java • Middleware development - bridge between Linux Kernel and GUI • Source code control Experience Profile: • BS in Computer Science or an applicable engineering subject and 3-5+ years of related software engineering experience • 2+ years software engineering for complex storage solutions • Loves programming • Experience developing middleware • Experience programming in Python (or C/C++ and/or Java) • Software Engineering experience in a Linux environment. • Experience with near-real time software development. • Stable employment history of direct employment Helpful/Preferred: • Experience in a start-up environment • Experience with real-time software development. (exposure to embedded software is helpful) • Enjoys diversity of tasks • Experience with GUI • Experience with C/C++ and/or Java • Experience with various Windows and Linux OS environments • Exposure to storage subsystems such as Fibre Channel, iSCSI, SAS, SATA, RAID, Snapshot, Replication, NAS, SAN, etc. • MS in Computer Science, or related degree Please apply at www.bluelinetalent.com/active_jobs NOTES: • Direct hire with comprehensive benefits • Local candidates please - no relocation assistance provided • Not available for Corp-to-Corp, no third parties please Ron Levis Principal, Talent Acquisition Mgr Blue Line Talent, LLC www.bluelinetalent.com www.linkedin.com/in/ronlevis (invitations are welcome) Moderator, Colorado IT Community on LinkedIn Groups Blue Line Talent is a member-owner of NPA, The Worldwide Recruiting Network, your connection to premier independent recruiting firms located throughout Europe, Asia, Australia, Africa and the Americas. -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about circular imports
Frank Millman wrote: The first solution is - in wavread.py - import formats.wavwrite in wavwrite.py - import formats.wavread I then have to use the full path to reference any attribute inside the imported module, which I find cumbersome. This isn't really true. If this is the only thing you're worried about, you can always do the manual version of a from X import Y: import formats.wavread wavread = formats.wavread wavread.someFunc() # refers to functions in module formats.wavread. Also, I'm too lazy to check right now, but I wouldn't be suprised if mport formats.wavread as wavread also works even in the circular case. -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail. --author unknown -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On Feb 26, 6:44 am, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I don't blame them for the attitude of live to fight another day or even for plain survival. If the Jews hadn't allow themselves to be subjected, there would be no Jews. And may i borrow your time machine now that you are finished researching what may have happened to the Jews had they adopted the live free or die mentality? I always wondered what it would feel like to be god. Slaves only exist because they allow themselves to exist. When people Never been a slave, were you? Try to imagine what it is to be born a slave. Don't try to cast me as siding with the slave-master. I detest them as much as anyone. But my point is still valid; empower the people and subjection is a thing of the past. Bullying is a microcosm of slavery. You could take two distinct defensive methods to fighting bullies: 1. you could fight each bully on a case by case bases. 2. you could empower people to fight bullies as a united group. Method one will always fail. Sure, you may defeat the bully that exists today, but tomorrow a new bully will be born. Whereas method 2 will always prevail. Bullies need to exist in the shadows, behind a veil of secrecy and fear. Remove the veil and they will be exposed. Adopt a public policy that bullying will NOT be allowed and the perp WILL be punished, and bulling disappears forever. History has shown that mob behavior can be both detrimentally sadistic AND masochistic. -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements
Albert van der Horst alb...@spenarnc.xs4all.nl writes: In article 40af8461-1583-4496-9d81-d52d6905d...@b23g2000yqn.googlegroups.com, Rick Johnson rantingrickjohn...@gmail.com wrote: Because the Jews allowed themselves to be subjected. Sad, but true. Actually Jew stands for (relative) coward. Let me explain. No, please don't. Slander of racial groups is not only off-topic here, it's wholly inappropriate regardless of your explanation. Stop doing it, and don't encourage it in others. -- \ “The sun never sets on the British Empire. But it rises every | `\morning. The sky must get awfully crowded.” —Steven Wright | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On Mon, Feb 27, 2012 at 7:35 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: 1. you could fight each bully on a case by case bases. 2. you could empower people to fight bullies as a united group. Adopt a public policy that bullying will NOT be allowed and the perp WILL be punished, and bulling disappears forever. Hmm, I wonder how you go about adopting that policy... oh! I know! By fighting each bully on a case-by-case basis! Funny though, you just said that won't work. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about circular imports
On 2/26/2012 6:12 AM, Peter Otten wrote: Frank Millman wrote: I seem to have a recurring battle with circular imports, and I am trying to nail it once and for all. ... This should be import sound.formats.wavread To avoid the tedious reference, follow this with read = sound.formats.wavread # choose the identifier you prefer -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: [RELEASED] Release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3
On 2/26/2012 3:51 AM, Ben Finney wrote: Benjamin Petersonbenja...@python.org writes: We're pleased to announce the immediate availability of release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3 . If you're pleased to announce their immediate availability, then please do that! Putting “RELEASED” in the subject, when they're not released and are instead *candidates for* release, is confusing and muddies the issue of what you even mean by “release”. I think the standard [RELEASED] tag is for the benefit of people who do not read the list but filter it for posts with such tags, perhaps automatically, so they know there is something new to go download. And indeed, there is something new to download. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On Feb 26, 2:50 pm, Chris Angelico ros...@gmail.com wrote: Hmm, I wonder how you go about adopting that policy... oh! I know! By fighting each bully on a case-by-case basis! Funny though, you just said that won't work. It's a two-pronged solution Chris. Compound. -- http://mail.python.org/mailman/listinfo/python-list
MAJOR JAVA EVANGELIST CONVERTS TO PYTHON !!!!!!!!!!!!!!
On Feb 26, 12:29 am, BV cv33cv33c...@gmail.com wrote: MAJOR CANADIAN CHRISTIAN MISSIONARY CONVERTS TO ISLAM MAJOR JAVA EVANGELIST CONVERTS TO PYTHON !! ...Hey, someone has to keep the spam around here on-topic. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python math is off by .000000000000045
Curiosity prompts me to ask... Those of you who program in other languages regularly: if you visit comp.lang.java, for example, do people ask this question about floating-point arithmetic in that forum? Or in comp.lang.perl? Is there something about Python that exposes the uncomfortable truth about practical computer arithmetic that these other languages obscure? For of course, arithmetic is surely no less accurate in Python than in any other computing language. I always found it helpful to ask someone who is confused by this issue to imagine what the binary representation of the number 1/3 would be. 0.011 to three binary digits of precision: 0.0101 to four: 0.01011 to five: 0.010101 to six: 0.0101011 to seven: 0.01010101 to eight: And so on, forever. So, what if you want to do some calculator-style math with the number 1/3, that will not require an INFINITE amount of time? You have to round. Rounding introduces errors. The more binary digits you use for your numbers, the smaller those errors will be. But those errors can NEVER reach zero in finite computational time. If ALL the numbers you are using in your computations are rational numbers, you can use Python's rational and/or decimal modules to get error-free results. Learning to use them is a bit of a specialty. But for those of us who end up with numbers like e, pi, or the square root of 2 in our calculations, the compromise of rounding must be accepted. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python math is off by .000000000000045
On 2/26/2012 7:24 PM, John Ladasky wrote: I always found it helpful to ask someone who is confused by this issue to imagine what the binary representation of the number 1/3 would be. 0.011 to three binary digits of precision: 0.0101 to four: 0.01011 to five: 0.010101 to six: 0.0101011 to seven: 0.01010101 to eight: And so on, forever. So, what if you want to do some calculator-style math with the number 1/3, that will not require an INFINITE amount of time? You have to round. Rounding introduces errors. The more binary digits you use for your numbers, the smaller those errors will be. But those errors can NEVER reach zero in finite computational time. Ditto for 1/3 in decimal. ... 0. to eitht If ALL the numbers you are using in your computations are rational numbers, you can use Python's rational and/or decimal modules to get error-free results. Decimal floats are about as error prone as binary floats. One can only exact represent a subset of rationals of the form n / (2**j * 5**k). For a fixed number of bits of storage, they are 'lumpier'. For any fixed precision, the arithmetic issues are the same. The decimal module decimals have three advantages (sometimes) over floats. 1. Variable precision - but there are multiple-precision floats also available outside the stdlib. 2. They better imitate calculators - but that is irrelevant or a minus for scientific calculation. 3. They better follow accounting rules for financial calculation, including a multiplicity of rounding rules. Some of these are laws that *must* be followed to avoid nasty consequences. This is the main reason for being in the stdlib. Learning to use them is a bit of a specialty. Definitely true. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: MAJOR JAVA EVANGELIST CONVERTS TO PYTHON !!!!!!!!!!!!!!
AND PYTHON IS REALLY COOL! Especially this beautiful JPype Bridge that makes it possible to push requests between PYTHON and JAVA. really really really cool! Am 27.02.2012 01:05, schrieb John Ladasky: On Feb 26, 12:29 am, BVcv33cv33c...@gmail.com wrote: MAJOR CANADIAN CHRISTIAN MISSIONARY CONVERTS TO ISLAM MAJOR JAVA EVANGELIST CONVERTS TO PYTHON !! ...Hey, someone has to keep the spam around here on-topic. -- http://mail.python.org/mailman/listinfo/python-list
Abort an HTTP request before the request timed out
Hi, I'm working in a small application, which tries to access data on a web server. Normally the request has a timeout of for example 60 seconds conn = httplib.HTTPConnection(server_name, server_port, timeout=60) while True: conn.request(GET, /my_url.php) try: resp = conn.getresponse() except HaveToLookUpNameOfTimeOutException as exc: print timed out continue parse_response(resp) Sometimes I would like to abort the request from another thread and force an immediate retry. How would I do this best? The other thread would be either a UI button or some other code knowing, when it is not good to wait the ull minute. Normally the timeout of 1 mintues is what I need though. Thanks for any suggestion. The solution should work on Windows and Linux -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Feb 26, 6:29 am, Rick Johnson rantingrickjohn...@gmail.com wrote: Sure there are float INFINITIES that work fine for ints and floats, but where is the consistency? Sure, there are all of the COMPLEXITIES of floating point arithmetic but I want to ignore all of that and demand ridiculous consistencies. Why should I have to do float(some_int) float('inf') when it's a far better use of my time to spend days if not weeks bemoaning yet another language wart? Why should I be expected to know what float('inf') actually represents before making stupid demands like: INFINITY need not be a int or a float or a str, or whatever. Please provide a non-contrived use case of an infinite string. INFINITY should be at the very least a constant of the math module. Why? This isn't a mathematical concept of 'infinite' when you're talking about comparing against str, or whatever. We need a more appropriate location; please initiate a PEP to add the namespace shit.rick.wants into the stdlib. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python math is off by .000000000000045
On Sun, 26 Feb 2012 16:24:14 -0800, John Ladasky wrote: Curiosity prompts me to ask... Those of you who program in other languages regularly: if you visit comp.lang.java, for example, do people ask this question about floating-point arithmetic in that forum? Or in comp.lang.perl? Yes. http://stackoverflow.com/questions/588004/is-javascripts-math-broken And look at the Linked sidebar. Obviously StackOverflow users no more search the internet for the solutions to their problems than do comp.lang.python posters. http://compgroups.net/comp.lang.java.programmer/Floating-point-roundoff-error -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Sun, 26 Feb 2012 18:32:27 -0800, alex23 wrote: On Feb 26, 6:29 am, Rick Johnson rantingrickjohn...@gmail.com wrote: Sure there are float INFINITIES that work fine for ints and floats, but where is the consistency? Sure, there are all of the COMPLEXITIES of floating point arithmetic but I want to ignore all of that and demand ridiculous consistencies. Why should I have to do float(some_int) float('inf') Ints and floats can be compared directly, no need to convert the int to a float first: INF = float('inf') 23 INF True Likewise Fractions and Decimals, at least in Python 3.2 (possibly not in older versions): from fractions import Fraction from decimal import Decimal Fraction(33, 5) INF True Decimal(42.1568) INF True when it's a far better use of my time to spend days if not weeks bemoaning yet another language wart? Why should I be expected to know what float('inf') actually represents before making stupid demands like: INFINITY need not be a int or a float or a str, or whatever. Please provide a non-contrived use case of an infinite string. Any lazy stream of characters that potentially goes on forever could be considered an infinite string. But that's not what Rick is talking about. He's talking about having a pair of special values, say, BIGGEST and SMALLEST, which compare larger and smaller to any other value, regardless of type and including strings, not literally a string with an infinite number of characters. I can see some value for this as a convenience, but not enough to make it a built-in language feature. Every developer should have at least one utility module with all the trivial code snippets they frequently use. This belongs in there. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Mon, Feb 27, 2012 at 2:51 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I can see some value for this as a convenience, but not enough to make it a built-in language feature. Every developer should have at least one utility module with all the trivial code snippets they frequently use. +1. I used to call mine oddsends - it nicely fitted into eight characters (yeah, was important then - I was on DOS), and I had quite a few odds and ends in there. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about circular imports
To avoid the tedious reference, follow this with read = sound.formats.wavread # choose the identifier you prefer @Terry and OKB I tried that, but it does not work. a.py /b __init__.py c.py d.py a.py - from b import c c.py - import b.d d.py - import b.c If I run a.py, it returns with no error. c.py - import b.d d = b.d d.py - import b.c c = b.c If I run a.py, I get Traceback (most recent call last): File F:\tests\a.py, line 1, in module from b import c File F:\tests\b\c.py, line 1, in module import b.d File F:\tests\b\d.py, line 2, in module c = b.c AttributeError: 'module' object has no attribute 'c' I get the same if I try 'import b.c as c'. Frank -- http://mail.python.org/mailman/listinfo/python-list
Re: PyWart: Language missing maximum constant of numeric types!
On Feb 27, 1:51 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Ints and floats can be compared directly, no need to convert the int to a float first Ah, cheers. You can see how often I use the two interchangeably :) Please provide a non-contrived use case of an infinite string. Any lazy stream of characters that potentially goes on forever could be considered an infinite string. But that's not what Rick is talking about. He's talking about having a pair of special values, say, BIGGEST and SMALLEST, which compare larger and smaller to any other value, regardless of type and including strings, not literally a string with an infinite number of characters. Yeah, my point was more to highlight Rick's laziness in co-opting a defined term - INFINITE - and trying to use it to mean something else that he couldn't express clearly. His original post stressed numeric comparison, the feature creep to include all other types happened later. Not the sort of thing we've come to expect from the resident linguist extraordinaire :) I can see some value for this as a convenience, but not enough to make it a built-in language feature. For me, it feels like a step backwards to comparing different types: 1 INFINITE True 'string' INFINITE True 1 'string' Traceback (most recent call last): File stdin, line 1, in module TypeError: unorderable types: int() str() Every developer should have at least one utility module with all the trivial code snippets they frequently use. This belongs in there. Agreed. Especially when it's so trivial: class Bound(object): def __init__(self, value=None, always_greater=False): self.value = value self.always_greater = always_greater def __cmp__(self, other): return True if self.always_greater else self.value.__cmp__(other) upper = Bound(100) 101 upper True 101 upper False infinite = Bound(always_greater=True) 101 infinite False 101 infinite True upper 101 infinite True -- http://mail.python.org/mailman/listinfo/python-list
How can I make an instance of a class act like a dictionary?
Hi everyone. I created a custom class and had it inherit from the dict class, and then I have an __init__ method like this: def __init__(self): self = create() The create function creates and returns a dictionary object. Needless to say, this is not working. When I create an instance of the above class, it is simply an empty dictionary rather than the populated dictionary being created by the create function. Am I doing the inheritance wrong, or am I getting the above syntax wrong by assigning the return value to self? I know I could do self.variable = create() and that works fine, but I thought it would be better (and cleaner) simply to use the instance itself as the dictionary, rather than have to go through an instance variable. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I make an instance of a class act like a dictionary?
On Sun, Feb 26, 2012 at 11:24 PM, John Salerno johnj...@gmail.com wrote: Hi everyone. I created a custom class and had it inherit from the dict class, and then I have an __init__ method like this: def __init__(self): self = create() The create function creates and returns a dictionary object. Needless to say, this is not working. When I create an instance of the above class, it is simply an empty dictionary rather than the populated dictionary being created by the create function. Am I doing the inheritance wrong, or am I getting the above syntax wrong by assigning the return value to self? Assignment to `self` has no effect outside the method in question; Python uses call-by-object (http://effbot.org/zone/call-by-object.htm ) for argument passing. Even in something like C++, I believe assignment to `this` doesn't work. I know I could do self.variable = create() and that works fine, but I thought it would be better (and cleaner) simply to use the instance itself as the dictionary, rather than have to go through an instance variable. Call the superclass (i.e. dict's) initializer (which you ought to be doing anyway): super(YourClass, self).__init__(create()) Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list
[issue6210] Exception Chaining missing method for suppressing context
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b299c4f31ff2 by Nick Coghlan in branch 'default': Close issue #6210: Implement PEP 409 http://hg.python.org/cpython/rev/b299c4f31ff2 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6210 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6210] Exception Chaining missing method for suppressing context
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6210 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12801] C realpath not used by os.path.realpath
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12801 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14082] shutil doesn't copy extended attributes
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14082 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6210] Exception Chaining missing method for suppressing context
Éric Araujo mer...@netwok.org added the comment: Thanks, I can’t wait to use that in my code! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6210 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14097] Improve the introduction page of the tutorial
Eli Bendersky eli...@gmail.com added the comment: Regarding the use of the name variable, could it be replaced by just name ? That might make sense since the error for undefined names is usually NameError. However, note that the current documentation has a /huge/ amount of mentions for variable, so we may be too late to the party. Éric - the word degenerate is considered offensive in a couple of languages I speak, but the docs are written in English, so the important point is whether this word is offensive *in English*. If not, I see no reason to drop it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14097 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14127] os.stat and os.utime: allow preserving exact metadata
New submission from Larry Hastings la...@hastings.org: Following on from Guido's rejection of PEP 410: http://mail.python.org/pipermail/python-dev/2012-February/116837.html This bug is the proposed hammering-out space for how to preserve exact metadata for st_atime / st_mtime between os.stat and os.utime. (Yes, there's already #11457 -- but that went pretty far down the rabbit hole of Decimal. I thought maybe a fresh start would be best.) -- components: Library (Lib) messages: 154316 nosy: larry priority: normal severity: normal status: open title: os.stat and os.utime: allow preserving exact metadata type: enhancement versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14127 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14128] _elementtree should expose types and factory functions consistently with ElementTree
New submission from Eli Bendersky eli...@gmail.com: Element, XMLParser and TreeBuilder are types in ElementTree, but factory functions in _elementtree. The latter should be modified to be consistent with the former. -- assignee: eli.bendersky components: Library (Lib) messages: 154317 nosy: eli.bendersky, flox, scoder priority: high severity: normal stage: needs patch status: open title: _elementtree should expose types and factory functions consistently with ElementTree type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14128 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6884] Impossible to include file in sdist that starts with 'build' on Win32
Nadeem Vawda nadeem.va...@gmail.com added the comment: For distutils2 however I have no tester and no bot, so could someone test this patch? I'll take a look at it. BTW if someone knows about a continuous integration service which provides Windows and Mac OS X VMs I’m all ears. Not sure about a CI service, but if you want Windows for your own machine I believe you can get a free MSDN subscription: http://mail.python.org/pipermail/python-committers/2011-August/001788.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6884 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14127] os.stat and os.utime: allow preserving exact metadata
Larry Hastings la...@hastings.org added the comment: Guido proposed st_atime_ns et al. I'll make an alternate proposal. I'd like to avoid tying ourselves to ns resolution. As MvL said: I don't want to deal with this issue *again* in my lifetime. If all we want is to facilitate copying the exact metadata from os.stat to os.utime, then we don't really care about conveniently modifying the timestamp. So I propose we use MvL's suggestion of a tuple of ints. Either (numerator, denominator) or (seconds, fractional_numerator, fractional_denominator). (These are mentioned in PEP 410 under the heading Tuple of ints as options A and B respectively.) Name the fields with the suffix _exact (e.g. st_mtime_exact). os.stat and its ilk produce it; os.utime and its ilk consume it. If people want to monkey with the values and do math, let 'em--consenting adults. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14127 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14128] _elementtree should expose types and factory functions consistently with ElementTree
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14128 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14123] Indicate that there are no current plans to deprecate printf-style formatting
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 80069bbae26d by Gregory P. Smith in branch '3.2': Issue #14123: Explicitly mention that old style % string formatting has caveats http://hg.python.org/cpython/rev/80069bbae26d New changeset 98a1855ebfe1 by Gregory P. Smith in branch 'default': Issue #14123: Explicitly mention that old style % string formatting has caveats but is not going away any time soon. http://hg.python.org/cpython/rev/98a1855ebfe1 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14123 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14128] _elementtree should expose types and factory functions consistently with ElementTree
Stefan Behnel sco...@users.sourceforge.net added the comment: Note that Element is also a factory function in lxml.etree, and people have been living with this quite happily. I don't see a reason to change either side. There is a dedicated function iselement(obj) for exactly the purpose of testing if something is an Element object. isinstance() is not the right way to do it and inheritance is not portable. (the right type to inherit from in lxml is actually called ElementBase) I'm fine with changing the other two (XMLParser and TreeBuilder), if only for consistency. Stefan -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14128 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14128] _elementtree should expose types and factory functions consistently with ElementTree
Eli Bendersky eli...@gmail.com added the comment: In the pydev discussion once Martin raised this problem it was agreed that this is a regression in 3.3 that should be fixed, since there is code out there that relies on subclassing Element. This would make the Python and C implementations of ET more consistent, which can't be a bad thing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14128 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)
Stefan Krah stefan-use...@bytereef.org added the comment: Nick Coghlan rep...@bugs.python.org wrote: PEP section makes sense - I plan to mark PEP 3118 as Final once you commit this (or you can do that yourself, for that matter). Array features are complete except for multi-dimensional indexing and slicing. I think it would be nice to add those in a separate issue; it's not a lot of additional code and it doesn't interfere with the current code. The overall array handling scheme is sound. Life would be a bit easier if contiguity flags were a mandatory part of the Py_buffer structure that the exporter has to fill in. Then there is an open issue (#3132) for expanding the struct module syntax, where the wording in some sections of the PEP led to a bit of head-scratching. :) In another issue (#13072) the question came up whether the proposed 'u' and 'w' formats still make sense after PEP-393 (I think they do, they should map to UCS-2 and UCS-4). We need to decide what to do about 2.7 and 3.2. It's pretty difficult by now to separate the bug fixes from the features. I could follow the example of CPU manufacturers: start with the whole feature set and disable as much as possible. Another problem for 2.7 and 3.2 is that the 'B' format would still need to accept bytes instead of ints. Or can we change that as a bug fix? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2394] [Py3k] Finish the memoryview object implementation
Stefan Krah stefan-use...@bytereef.org added the comment: I think this issue is now superseded by #10181 and #3132. -- nosy: +skrah resolution: - duplicate stage: test needed - committed/rejected status: open - pending superseder: - Problems with Py_buffer management in memoryobject.c (and elsewhere?) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2394 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2394] [Py3k] Finish the memoryview object implementation
Changes by Stefan Krah stefan-use...@bytereef.org: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2394 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
New submission from Eli Bendersky eli...@gmail.com: I'm now carefully reading through the extending documentation pages. This issue will record various problems I find on the way, with the intention of fixing them eventually. -- assignee: eli.bendersky components: Documentation keywords: easy messages: 154325 nosy: eli.bendersky priority: low severity: normal status: open title: Corrections for the extending doc versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: extending.html has a reference to Demo/embed/demo.c which no longer exists in the source distribution -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)
Nick Coghlan ncogh...@gmail.com added the comment: Aw, I guess I was too optimistic in thinking this was the last gap before we could declare it Final... +1 on creating a new feature request for NumPy style multi-dimensional indexing and slicing support on memoryview (I'm assuming that's what you meant). As far as your last question goes, I'm not sure we *can* salvage this in 2.7/3.2. We do have the option of throwing our hands up in the air and saying Sorry, we couldn't figure out how to fix it without completely rewriting it. Take a look at 3.3 if you want to see how it's *supposed* to work. I hesitate to suggest this (since I'm not volunteering to do the work) but perhaps it would be worth packaging up the 3.3. memoryview and publishing it on PyPI for the benefit of 3.2 and 2.7? May also be worth bringing up on python-dev to see if anyone else has any bright ideas. Myself, I'm not seeing any real choices beyond won't fix, backport 3.3 version and remove/disable the new features, backport 3.3 version, new features and all and publish a full featured version on PyPI. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6884] Impossible to include file in sdist that starts with 'build' on Win32
Adam Groszer agros...@gmail.com added the comment: Hello, On Sun, 26 Feb 2012 03:37:06 + you wrote: BTW if someone knows about a continuous integration service which provides Windows and Mac OS X VMs I’m all ears. ZTK (Zope toolkit) ended up with renting a windows (server) VM. http://winbot.zope.org/ There we run a buildbot that does the windows releases of some packages (zope.interface, zope.proxy, etc) and runs the tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6884 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14128] _elementtree should expose types and factory functions consistently with ElementTree
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +effbot ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14128 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14107] Debian bigmem buildbot hanging in test_bigmem
Charles-François Natali neolo...@free.fr added the comment: Thread 0x2ba588709700: File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/support.py, line 1168 in consumer File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/threading.py, line 682 in run File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/threading.py, line 729 in _bootstrap_inner File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/threading.py, line 702 in _bootstrap Current thread 0x2ba57b2d4260: File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/support.py, line 1198 in stop File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/support.py, line 1240 in wrapper File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/case.py, line 385 in _executeTestPart File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/case.py, line 440 in run File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/case.py, line 492 in __call__ File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/suite.py, line 105 in run File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/suite.py, line 67 in __call__ File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/suite.py, line 105 in run File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/suite.py, line 67 in __call__ File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/unittest/runner.py, line 168 in run File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/support.py, line 1369 in _run_suite File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/support.py, line 1403 in run_unittest File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_bigmem.py, line 1252 in test_main File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/regrtest.py, line 1221 in runtest_inner File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/regrtest.py, line 907 in runtest File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/regrtest.py, line 710 in main File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/__main__.py, line 13 in module File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/runpy.py, line 73 in _run_code File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/runpy.py, line 160 in _run_module_as_main There's a problem with the _file_watchdog thread: if the pipe gets full (because the consumer thread doesn't get to run often enough), the watchdog thread will block on the write() to the pipe. Then, the main thread tries to stop the watchdog: static void cancel_file_watchdog(void) { /* Notify cancellation */ PyThread_release_lock(watchdog.cancel_event); /* Wait for thread to join */ PyThread_acquire_lock(watchdog.running, 1); PyThread_release_lock(watchdog.running); /* The main thread should always hold the cancel_event lock */ PyThread_acquire_lock(watchdog.cancel_event, 1); } The `cancel_event` lock is released, but the watchdog thread is stuck on the write(). The only thing that could wake it up is a read() from the consumer thread, but the main thread - the one calling cancel_file_watchdog() - blocks when acquiring the `running` lock: since the GIL is not released, the consumer thread can't run, so it doesn't drain the pipe, and game over... /* We can't do anything if the consumer is too slow, just bail out */ if (write(watchdog.wfd, (void *) x, sizeof(x)) sizeof(x)) break; if (write(watchdog.wfd, data, data_len) data_len) break; AFAICT, this can't happen, because the write end of the pipe is not in non-blocking mode (which would solve this issue). Otherwise, there are two things I don't understand: 1. IIUC, the goal of the watchdog thread is to collect memory consumption in a timely manner: that's now the case, but since the information is printed in a standard thread, it doesn't bring any improvement (because it can be delayed for arbitrarily long), or am I missing something? 2. instead of using a thread and the faulthandler infrastructure to run GIL-less, why not simply use a subprocess? It could then simply parse /proc/PID/statm at a regular interval, and print stats to stdout. It would also solve point 1. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14128] _elementtree should expose types and factory functions consistently with ElementTree
Stefan Behnel sco...@users.sourceforge.net added the comment: For the record, the relevant mailing list discussion can be found here: http://thread.gmane.org/gmane.comp.python.devel/129429/focus=129794 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14128 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing
Florent Xicluna florent.xicl...@gmail.com added the comment: the class versus factory issue is gone to issue 14128. The current issue is only about the doctype() method missing in the C implementation. I propose to drop this deprecated method from the Python version, instead of implementing the deprecated method in the C version. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14007 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13238] Add shell command helpers to subprocess module
Nick Coghlan ncogh...@gmail.com added the comment: For a different take on this concept: http://julialang.org/manual/running-external-programs/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13238 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing
Eli Bendersky eli...@gmail.com added the comment: Florent, The deprecation should be probably raised separately on pydev. From the recent discussions on this and similar topics, I doubt that removal of these methods will be accepted. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14007 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14127] os.stat and os.utime: allow preserving exact metadata
Martin v. Löwis mar...@v.loewis.de added the comment: OTOH, it seems that Guido is very much in favor of hard-coding ns resolution in the API, claiming that expectations of even finer resolution are academic. While I still disagree (the *very* same argument was brought up for ms resolution ten years ago), I think that practicality beats purity here: people apparently can deal with an fixed scale much better than with a floating one. So it may be better to meet the apparent intuition of the majority than follow the purity route. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14127 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14107] Debian bigmem buildbot hanging in test_bigmem
Charles-François Natali neolo...@free.fr added the comment: 1. IIUC, the goal of the watchdog thread is to collect memory consumption in a timely manner: that's now the case, but since the information is printed in a standard thread, it doesn't bring any improvement (because it can be delayed for arbitrarily long), or am I missing something? Scratch that. It does bring an improvement for a post facto analysis (I thought at first it was used in a pseudo-realtime way). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14130] memoryview: add multi-dimensional indexing and slicing
Changes by Stefan Krah stefan-use...@bytereef.org: -- assignee: skrah nosy: ncoghlan, pitrou, pv, skrah, teoliphant priority: normal severity: normal stage: needs patch status: open title: memoryview: add multi-dimensional indexing and slicing type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14130 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14130] memoryview: add multi-dimensional indexing and slicing
New submission from Stefan Krah stefan-use...@bytereef.org: The PEP-3118 authors originally planned to have support for multi-dimensional indexing and slicing in memoryview. Since memoryview now already has the capabilities of multi-dimensional list representations and comparisons, this would be a nice addition to the feature set. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14130 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14130] memoryview: add multi-dimensional indexing and slicing
Changes by Stefan Krah stefan-use...@bytereef.org: -- components: +Interpreter Core versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14130 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1116520] Prefix search is filesystem-centric
Nick Coghlan ncogh...@gmail.com added the comment: Yeah, I'm pretty sure the bootstrap mechanism needs to be able to get hold of os.py directly so it can be injected into the importlib._bootstrap namespace. However, it may be worth figuring out and documenting the bare minimum that has to exist on the filesystem in order for importlib to get going. It's even possible that Brett freezes enough into the interpreter binary that the required set has shrunk to zero. -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1116520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing
Florent Xicluna florent.xicl...@gmail.com added the comment: I understand the point about compatibility. However it is slightly different here, because the method is already deprecated in Python 2.7 and 3.2, with a warning in the documentation and a DeprecationWarning at runtime. This method was never available in the C version, and the documentation is clear about the recommended way of writing a custom doctype handler. Arguably, it is not the most popular feature of ElementTree. I am not opposed to adding the deprecated method in the C implementation, but it will need someone to do the patch, taking care of raising the deprecation warning correctly, and taking care of the case where XMLParser is subclassed. Is it worth the hassle? Please not that contrary to what is stated in the first message (msg153328), the doctype() method is not defined on the default TreeBuilder (Python) class. The documentation suggests to add it on custom TreeBuilder implementations. -- priority: high - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14007 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14131] test_threading failure on WIndows 7 3.x buildbot
New submission from Nick Coghlan ncogh...@gmail.com: http://www.python.org/dev/buildbot/all/builders/x86%20Windows7%203.x/builds/4458/steps/test/logs/stdio Appears to be new, but also isn't obviously related to any recent checkins that I noticed. (the Win7 buildbot for trunk isn't in a good place, with regular test_packaging and test_strptime values, too). -- keywords: buildbot messages: 154339 nosy: ncoghlan priority: normal severity: normal status: open title: test_threading failure on WIndows 7 3.x buildbot versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7562] Custom order for the subcommands of build
Changes by Peter Kleiweg pklei...@xs4all.nl: -- nosy: +pebbe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7562 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8706] accept keyword arguments on all base type methods and builtins
Filip Gruszczyński grusz...@gmail.com added the comment: I don't know if this is exactly what you want, but this is an early patch. -- keywords: +patch nosy: +gruszczy Added file: http://bugs.python.org/file24644/8706.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8706 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: in this case, nothing more than every Python object contains There's a grammar error lurking somewhere in there... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: A PyObject is not a very magnificent object - it just contains the refcount and a pointer to the object’s “type object”. Too chatty and should be replaced by a more pragmatic explanation, or shortened. -- nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14007] xml.etree.ElementTree - XMLParser and TreeBuilder's doctype() method missing
Florent Xicluna florent.xicl...@gmail.com added the comment: This last feature (doctype handler on custom TreeBuilder) does not have tests... So, it is certainly broken with the C implementation. -- stage: needs patch - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14007 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: This is not strictly in the extending doc, but linked from it: http://docs.python.org/dev/c-api/type.html#PyType_GenericNew The PyType_GenericNew API function is not documented -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14107] Debian bigmem buildbot hanging in test_bigmem
Antoine Pitrou pit...@free.fr added the comment: /* We can't do anything if the consumer is too slow, just bail out */ if (write(watchdog.wfd, (void *) x, sizeof(x)) sizeof(x)) break; if (write(watchdog.wfd, data, data_len) data_len) break; AFAICT, this can't happen, because the write end of the pipe is not in non-blocking mode (which would solve this issue). I think my original plan was to put it in non-blocking mode, but I must have forgotten in the end. 2. instead of using a thread and the faulthandler infrastructure to run GIL-less, why not simply use a subprocess? It could then simply parse /proc/PID/statm at a regular interval, and print stats to stdout. It would also solve point 1. I can't think of any drawback off the top of my head, so that sounds reasonable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: Let’s expend Typo -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: The new method calls the tp_alloc slot to allocate memory tp_alloc needs formatting here, similarly to the way it's done in other places -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: Noddy_name in the full code listing (included from noddy2.c) is different from the Noddy_name that is actually explained later -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14129] Corrections for the extending doc
Eli Bendersky eli...@gmail.com added the comment: but in this cased Typo [this and the past couple of comments refer to the newtypes.html doc] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14131] test_threading failure on WIndows 7 3.x buildbot
Stefan Krah stefan-use...@bytereef.org added the comment: Strange, I can't reproduce this on Windows 7 with exactly the same command line: python_d -Wd -E -bb ../lib/test/regrtest.py -uall -rwW -n -r --randseed=8022149 -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14131] test_threading failure on WIndows 7 3.x buildbot
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +db3l ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14131] test_threading failure on WIndows 7 3.x buildbot
Nadeem Vawda nadeem.va...@gmail.com added the comment: This is rather curious. It looks like the assertion includes a (generous) fudge factor in case the timing code is inaccurate, but then the actual time taken is *just* short enough to make it fail. (the Win7 buildbot for trunk isn't in a good place, with regular test_packaging and test_strptime values, too). I can't find any recent failures of test_packaging; do you mean test_imp? I've opened issue 14113 for the test_strptime failures; it looks like something's forgetting (or stripping off) a leading zero somewhere. -- components: +Tests nosy: +nadeem.vawda stage: - needs patch type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14131 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14085] PyUnicode_WRITE: comparison is always true warnings
Florent Xicluna florent.xicl...@gmail.com added the comment: Same on OSX, building trunk (3.3.0a0) $ uname -v Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) $ ./configure MACOSX_DEPLOYMENT_TARGET=10.8 --with-pydebug (...) $ make -s -j12 (...) Objects/unicodeobject.c: In function ‘PyUnicode_FromFormatV’: Objects/unicodeobject.c:2729: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:2729: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:2729: warning: comparison is always true due to limited range of data type Python/import.c: In function ‘make_compiled_pathname’: Python/import.c:981: warning: comparison is always true due to limited range of data type Python/import.c:981: warning: comparison is always true due to limited range of data type Python/import.c:981: warning: comparison is always true due to limited range of data type Python/import.c:987: warning: comparison is always true due to limited range of data type Python/import.c:987: warning: comparison is always true due to limited range of data type Python/import.c:987: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c: In function ‘PyUnicode_DecodeUTF16Stateful’: Objects/unicodeobject.c:5525: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5525: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5526: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5526: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5528: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5528: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5529: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:5529: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c: In function ‘PyUnicode_DecodeASCII’: Objects/unicodeobject.c:6929: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:6929: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:6929: warning: comparison is always true due to limited range of data type Python/formatter_unicode.c: In function ‘fill_number’: Python/formatter_unicode.c:561: warning: comparison is always true due to limited range of data type Python/formatter_unicode.c:561: warning: comparison is always true due to limited range of data type Python/formatter_unicode.c:561: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c: In function ‘unicode_repr’: Objects/unicodeobject.c:12325: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12325: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12325: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12326: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12326: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12326: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12344: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12344: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12344: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12345: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12345: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12345: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12351: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12351: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12351: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12352: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12352: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12352: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12353: warning: comparison is always true due to limited range of data type Objects/unicodeobject.c:12353: warning: comparison is always true due to limited
[issue14107] Debian bigmem buildbot hanging in test_bigmem
Charles-François Natali neolo...@free.fr added the comment: I think my original plan was to put it in non-blocking mode, but I must have forgotten in the end. Here's a patch. I can't think of any drawback off the top of my head, so that sounds reasonable. I'll try to write up a patch (I have only 1.2GB RAM, so it won't be easy to test :-). -- keywords: +patch Added file: http://bugs.python.org/file24645/mem_watchdog_nonblock.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com