Re: Decimals and other numbers

2015-01-08 Thread Dave Angel
On 01/09/2015 02:37 AM, Chris Angelico wrote: On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa wrote: Devin Jeanpierre : If 0**0 is defined, it must be 1. You can "justify" any value a within [0, 1]. For example, choose y(a, x) = log(a, x) Then, limy(a, x) = 0 x -> 0+ and

Re: Decimals and other numbers

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa wrote: > Devin Jeanpierre : > >> If 0**0 is defined, it must be 1. > > You can "justify" any value a within [0, 1]. For example, choose > >y(a, x) = log(a, x) > > Then, > > limy(a, x) = 0 >x -> 0+ > > and: > >lim[x -> 0+] x**y(a, x

Re: Array of hash table

2015-01-08 Thread Dave Angel
On 01/09/2015 02:17 AM, jyoti690sa...@gmail.com wrote: Hello, Can any one tell me how to create graph={ "nodes": [ { "id": "n0", "label": "A node", "x": 0, "y": 0, "size": 3 }, { "id": "n1", "label": "Another node",

Re: Decimals and other numbers

2015-01-08 Thread Marko Rauhamaa
Devin Jeanpierre : > If 0**0 is defined, it must be 1. You can "justify" any value a within [0, 1]. For example, choose y(a, x) = log(a, x) Then, limy(a, x) = 0 x -> 0+ and: lim[x -> 0+] x**y(a, x) = a For example, >>> a = 0.5 >>> x = 1e-100 >>> y = math.log(a, x)

Array of hash table

2015-01-08 Thread jyoti690saini
Hello, Can any one tell me how to create graph={ "nodes": [ { "id": "n0", "label": "A node", "x": 0, "y": 0, "size": 3 }, { "id": "n1", "label": "Another node", "x": 3, "y": 1, "size": 2 }, { "id": "n2",

Re: how to create a soap enveloppe with python suds for consume a bssv web service

2015-01-08 Thread dieter
brice DORA writes: > ... >> "suds" should generate those required "SOAP envelope". >> >> "suds" can be set up to log the precise messages sent and received >> (consult the "suds" documentation about logging and the Python >> documentation about its "logging" module). With these messages >> (and a

Re: Decimals and other numbers

2015-01-08 Thread Marko Rauhamaa
Dave Angel : > What you don't say is which behavior you actually expected. Since 0**0 > is undefined mathematically, I'd expect either an exception or a NAN > result. IEEE 754 mandates that 0**0 should evaluate to 1: http://en.wikipedia.org/wiki/NaN#Operations_generating_NaN> The standar

Re: what is Jython?

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 3:10 PM, Brian wrote: > I tried to find out more on the internet but didn't have much success. All > I know is that its a combination of Python and Java. > Is it more Java than Python or the other way around? > Is Jython free like Python? > Is the programming language for Jy

what is Jython?

2015-01-08 Thread Brian
I tried to find out more on the internet but didn't have much success. All I know is that its a combination of Python and Java. Is it more Java than Python or the other way around? Is Jython free like Python? Is the programming language for Jython similar to Python or similar to Java? Are there pro

Re: Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
Thanks Ben, with your encouragement I have filed http://bugs.python.org/issue23201 -- Devin On Thu, Jan 8, 2015 at 7:03 PM, Ben Finney wrote: > Dave Angel writes: > >> What you don't say is which behavior you actually expected. Since >> 0**0 is undefined mathematically, I'd expect either an ex

Re: Decimals and other numbers

2015-01-08 Thread Ben Finney
Dave Angel writes: > What you don't say is which behavior you actually expected. Since > 0**0 is undefined mathematically, I'd expect either an exception or a > NAN result. Do you think that the ‘int’ and ‘float’ types, which do produce a number result for ‘0 ** 0’, are buggy and should be fixe

Re: Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel wrote: > What you don't say is which behavior you actually expected. Since 0**0 is > undefined mathematically, I'd expect either an exception or a NAN result. It can be undefined, if you choose for it to be. You can also choose to not define 0**1, of co

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread Denis McMahon
On Thu, 08 Jan 2015 22:07:03 +, Denis McMahon wrote: > On Thu, 08 Jan 2015 09:09:18 -0800, semeon.risom wrote: > >> Simple question. I hope. . To follow up, below is a solution to the problem you stated. #!/usr/bin/python import Image, ImageDraw, math def makeimg(length, orientation):

Re: Decimals and other numbers

2015-01-08 Thread Chris Rebert
On Thu, Jan 8, 2015 at 6:33 PM, Devin Jeanpierre wrote: > I noticed some very PHP-ish behavior today: > import decimal x = 0 y = float(x) z = decimal.Decimal(x) x == y == z == x > True x ** x > 1 y**y > 1.0 z**z > Traceback (most recent call last): > File

Re: Decimals and other numbers

2015-01-08 Thread Dave Angel
On 01/08/2015 09:33 PM, Devin Jeanpierre wrote: I noticed some very PHP-ish behavior today: import decimal x = 0 y = float(x) z = decimal.Decimal(x) x == y == z == x True x ** x 1 y**y 1.0 z**z Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/decimal

Re: Decimals and other numbers

2015-01-08 Thread Ben Finney
Devin Jeanpierre writes: > decimal.InvalidOperation: 0 ** 0 > > I'd file a bug report but I'm anticipating some rational (heh) > explanation. Any ideas? First note that it's explicitly documented as an invalid operation . So someone has at least thought about it and deliberately decided it shoul

Re: Where to learn current best Python packaging practices

2015-01-08 Thread Ben Finney
Rick Johnson writes: > On Thursday, January 8, 2015 at 7:12:18 PM UTC-6, Ben Finney wrote: > > > That does not contradict the position that [python packaging] is an > > ornery beast full of hidden traps and compromises though; it just > > means that everything that came before it (in Python) is w

Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
I noticed some very PHP-ish behavior today: >>> import decimal >>> x = 0 >>> y = float(x) >>> z = decimal.Decimal(x) >>> x == y == z == x True >>> x ** x 1 >>> y**y 1.0 >>> z**z Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/decimal.py", line 2216, in __pow__

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 1:12 PM, Ian Kelly wrote: > Or to never have to worry about it: > > INF = 1e400 > while not math.isinf(INF): > INF *= INF With no imports whatsoever: inf = 1e400 nan = inf-inf while nan == nan: inf *= inf nan = inf-inf But now we're getting stupid :) ChrisA -

Re: exporting c_variable to embedded python module

2015-01-08 Thread kenakahn
I want to access c-side global variables from the python side. -- https://mail.python.org/mailman/listinfo/python-list

Re: where in Nan defined

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 7:07 PM, Chris Angelico wrote: > On Fri, Jan 9, 2015 at 12:46 PM, Steven D'Aprano >> The fallback rule I use when float('nan') fails is >> >> INF = 1e3000 # Hopefully, this should overflow to INF. >> NAN = INF-INF # And this hopefully will give a NaN. > > The first

Re: application console with window

2015-01-08 Thread Rick Johnson
On Thursday, January 8, 2015 at 10:54:22 AM UTC-6, Chris Warrick wrote: > On Thu, Jan 8, 2015 at 5:18 PM, adam wrote: > > I just learn python. If you write in Polish it will be easier for me to > > explain any problem, because my English is very thin. > > You cannot really learn to program without

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 12:46 PM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen >> wrote: >>>>>> 0*1e400 >>>nan >> >> Nice, that's shorter than mine. > > I'm not entirely sure, but I suspect that 0*1e400 may not be quite as > portable

Re: Can numpy do better than this?

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 7:07:26 AM UTC+5:30, Ian wrote: > On Thu, Jan 8, 2015 at 6:13 PM, Rustom Mody wrote: > > With that I came up with the expression > > > > transpose(array([list(roll(mat[:,i],i,0)) for i in range(mat.shape[1])])) > > > > Not exactly pretty. > > My hunch is it can be impr

Re: where in Nan defined

2015-01-08 Thread Steven D'Aprano
Chris Angelico wrote: > On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen > wrote: >>>>> 0*1e400 >>nan > > Nice, that's shorter than mine. o_O Is that really the sort of thing you should be revealing here? Oh wait, you're talking about code... I'm not entirely sure, but I suspect tha

Re: Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Rick Johnson
On Thursday, January 8, 2015 at 7:12:18 PM UTC-6, Ben Finney wrote: > That does not contradict the position that [python > packaging] is an ornery beast full of hidden traps and > compromises though; it just means that everything that > came before it (in Python) is worse Ben, you've just proven

Re: Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 6:42:18 AM UTC+5:30, Ben Finney wrote: > Steven D'Aprano writes: > > > Is there a good tutorial to learn about pip? > > I'll answer what I think is the correct question: where to learn about > the current best Python packaging practices. In order to attain to full I

Re: Can numpy do better than this?

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 6:13 PM, Rustom Mody wrote: > With that I came up with the expression > > transpose(array([list(roll(mat[:,i],i,0)) for i in range(mat.shape[1])])) > > Not exactly pretty. > My hunch is it can be improved??... Hmm, you could use the column_stack constructor to avoid having

Re: Can numpy do better than this?

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 6:43:45 AM UTC+5:30, Rustom Mody wrote: > On Friday, January 9, 2015 at 12:58:52 AM UTC+5:30, Ian wrote: > > On Thu, Jan 8, 2015 at 10:56 AM, Rustom Mody wrote: > > > Given a matrix I want to shift the 1st column 0 (ie leave as is) > > > 2nd by one place, 3rd by 2 plac

Re: Can numpy do better than this?

2015-01-08 Thread Rustom Mody
On Friday, January 9, 2015 at 12:58:52 AM UTC+5:30, Ian wrote: > On Thu, Jan 8, 2015 at 10:56 AM, Rustom Mody wrote: > > Given a matrix I want to shift the 1st column 0 (ie leave as is) > > 2nd by one place, 3rd by 2 places etc. > > > > This code works. > > But I wonder if numpy can do it shorter a

Where to learn current best Python packaging practices (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Ben Finney
Steven D'Aprano writes: > Is there a good tutorial to learn about pip? I'll answer what I think is the correct question: where to learn about the current best Python packaging practices. We have recently gained an official body whose explicit job is to direct, and be opinionated about, packagin

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 11:41 AM, Steven D'Aprano wrote: > "oh, pip did the wrong thing again? you can fix that by standing on one leg, > sacrificing a goat to the Great Old Dark Ones, deleting these files, or > possibly some other ones, and if the phase of the moon is exactly right it > will behav

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Steven D'Aprano
Irmen de Jong wrote: > On 8-1-2015 12:16, Steven D'Aprano wrote: > >> I screwed up the upload to PyPI, and it won't allow you to upload the >> same version twice. (At least, I don't know of any way to do so.) So I >> had to bump the version number to re-upload. > > You can manually log into PyPI

Re: PyPI files should not change their payload (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Steven D'Aprano
Ben Finney wrote: > Steven D'Aprano writes: > >> I screwed up the upload to PyPI, and it won't allow you to upload the >> same version twice. (At least, I don't know of any way to do so.) So I >> had to bump the version number to re-upload. > > There is currently a hack that can be done (I won'

Re: Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 11:06 AM, Ben Finney wrote: > I've now produced a small Python library which knows how to transform a > reST Changelog to package metadata; and how to get that package metadata > into and out of a Python distribution with Distutils. > > The result is that I will never again

Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Ben Finney
Steven D'Aprano writes: > Ben Finney wrote: > > The source has a ‘CHANGES.txt’ file which has no entry later than > > version 0.2a. Why was the later version made, and when will the > > change log be updated for that? > > Ah, I knew I forgot something! The perils of duplicate sources of informat

PyPI files should not change their payload (was: Announce: PyPrimes 0.2.1a)

2015-01-08 Thread Ben Finney
Steven D'Aprano writes: > I screwed up the upload to PyPI, and it won't allow you to upload the > same version twice. (At least, I don't know of any way to do so.) So I > had to bump the version number to re-upload. There is currently a hack that can be done (I won't say what it is) to upload a

Re: exporting c_variable to embedded python module

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 8:03 AM, wrote: > I'm running a python script loaded via PyImport_Import in my C++ program on > Linux. Is there any way I can pass a value from the c-code to the loaded > python module? To answer this question, first think about how you would like to see that value on t

PyDev 3.9.1 Released

2015-01-08 Thread Fabio Zadrozny
What is PyDev? --- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on

Re: application console with window

2015-01-08 Thread jacek pozniak
adam wrote: > Hej, no właśnie niechodzi o przeniesienie do okienek tylko jeśli znasz > taki program jak np fk dla dos-a to chodzi mi o taki efekt. Czyli > aplikacja konsolowa z pseudo okienkami. Napisz sobie w bashu z wykorzystaniem programu dialog (man dialog) i ewntualnym wołaniem skryptów pyth

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Irmen de Jong
On 8-1-2015 12:16, Steven D'Aprano wrote: > I screwed up the upload to PyPI, and it won't allow you to upload the same > version twice. (At least, I don't know of any way to do so.) So I had to > bump the version number to re-upload. You can manually log into PyPI and fix the uploaded files using

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread Denis McMahon
On Thu, 08 Jan 2015 09:09:18 -0800, semeon.risom wrote: > Simple question. I hope. . We just covered this in the PHP newsgroup where you were trying to use a PHP library to generate these images. As your library code is written in PHP, I suggest you return to the discussion there unless yo

exporting c_variable to embedded python module

2015-01-08 Thread kenakahn
I'm running a python script loaded via PyImport_Import in my C++ program on Linux. Is there any way I can pass a value from the c-code to the loaded python module? -- https://mail.python.org/mailman/listinfo/python-list

Re: Comparisons and sorting of a numeric class....

2015-01-08 Thread Marko Rauhamaa
Ian Kelly : >> An advantage of the Scheme way is the chaining of "and" and "or". For >> example, this breaks in Python: >> >>def dir_contents(path): >>if os.path.isdir(path): >>return os.listdir(path) >>return None >> >>def get_choices(): >>return dir_co

Re: Can numpy do better than this?

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 10:56 AM, Rustom Mody wrote: > Given a matrix I want to shift the 1st column 0 (ie leave as is) > 2nd by one place, 3rd by 2 places etc. > > This code works. > But I wonder if numpy can do it shorter and simpler. > > - > def transpose(mat): > return(

Re: Hello World

2015-01-08 Thread Grant Edwards
On 2015-01-08, Michael Torrie wrote: > On 01/08/2015 10:02 AM, Steve Hayes wrote: >> On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) >> wrote: >> >>> I don't trust sudo because it is too complicated. (To the point that >>> I removed it from my machine.) I do >> >> H

Re: Comparisons and sorting of a numeric class....

2015-01-08 Thread Chris Kaynor
On Thu, Jan 8, 2015 at 6:57 AM, Ian Kelly wrote: > On Wed, Jan 7, 2015 at 11:21 PM, Marko Rauhamaa wrote: > > Steven D'Aprano : > > > >> Marko Rauhamaa wrote: > >>> I prefer the Scheme way: > >>>#f is a falsey object > >>>everything else is a truthy object > >> > >> The Scheme way has no

Re: How do I remove/unlink wildcarded files

2015-01-08 Thread Marko Rauhamaa
Rick Johnson : > If history has taught us anything, it is that, intelligence will > *ALWAYS* defeat brute strength, and that the *MOST* intelligent > societies are consequently those who possess both a humbled respect > for freedom, and a vile rejection of oppression. Impressive. With such a high

Can numpy do better than this?

2015-01-08 Thread Rustom Mody
Given a matrix I want to shift the 1st column 0 (ie leave as is) 2nd by one place, 3rd by 2 places etc. This code works. But I wonder if numpy can do it shorter and simpler. - def transpose(mat): return([[l[i] for l in mat]for i in range(0,len(mat[0]))]) def rotate(mat):

Re: Hello World

2015-01-08 Thread Michael Torrie
On 01/08/2015 10:02 AM, Steve Hayes wrote: > On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) > wrote: > >> I don't trust sudo because it is too complicated. >> (To the point that I removed it from my machine.) >> I do > > How do you do that? > > I avoided Ubuntu bec

Re: Hello World

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 4:02 AM, Steve Hayes wrote: > On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) > wrote: > >>I don't trust sudo because it is too complicated. >>(To the point that I removed it from my machine.) >>I do > > How do you do that? > > I avoided Ubuntu

Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-08 Thread semeon . risom
Hello - Simple question. I hope. I have 600 images (jpg) I am trying to generate. Each image will be made up of a line, with specific orientation (degrees) and length values (pixel). The background will be white (rgb: 255,255,255). I'm hoping each will have a name that corresponds to these va

Re: Hello World

2015-01-08 Thread Steve Hayes
On 08 Jan 2015 12:43:33 GMT, alb...@spenarnc.xs4all.nl (Albert van der Horst) wrote: >I don't trust sudo because it is too complicated. >(To the point that I removed it from my machine.) >I do How do you do that? I avoided Ubuntu because it had sudo, and then discovered that Fedora had it as wel

Re: application console with window

2015-01-08 Thread Chris Warrick
On Thu, Jan 8, 2015 at 5:18 PM, adam wrote: > I just learn python. If you write in Polish it will be easier for me to > explain any problem, because my English is very thin. You cannot really learn to program without speaking English well. If you can’t speak English, you will have lots of issues

Re: application console with window

2015-01-08 Thread adam
Emil Oppeln-Bronikowski wrote: > On Thu, Jan 08, 2015 at 05:18:07PM +0100, adam wrote: > >> I just learn python. > > We all do. It's a constant process. > >> If you write in Polish it will be easier for me to >> explain any problem, because my English is very thin. > > I don't really want to f

Re: application console with window

2015-01-08 Thread Emil Oppeln-Bronikowski
On Thu, Jan 08, 2015 at 05:18:07PM +0100, adam wrote: > I just learn python. We all do. It's a constant process. > If you write in Polish it will be easier for me to > explain any problem, because my English is very thin. I don't really want to force others to read Polish, hit me private if yo

Re: application console with window

2015-01-08 Thread adam
Emil Oppeln-Bronikowski wrote: > On Wed, Jan 07, 2015 at 10:17:09PM +0100, adam wrote: >> Is in here maybe someone who speak Polish? > > Mówię, a raczej piszę. > >> I'm looking for some libs, tutorials, or other informations. > > This is terminal application using (n)curses or smilar library th

Re: application console with window

2015-01-08 Thread adam
Dennis Lee Bieber wrote: > On Wed, 07 Jan 2015 22:17:09 +0100, adam > declaimed the following: > >>Is in here maybe someone who speak Polish? >> >>I would like to write application witch looks like this >>http://linuxiarze.pl/obrazy/internet1/ceni1.png >> > Based upon the image, that is mainly a

AssertionError (3.X only) when calling Py_Finalize with threads

2015-01-08 Thread Tom Kent
I'm getting an error output when I call the C-API's Py_Finalize() from a different C-thread than I made a python call on. The error I'm seeing is: Exception ignored in: Traceback (most recent call last): File "C:\Python34-32\Lib\threading.py", line 1289, in _shutdown assert tlock.locked()

Re: application console with window

2015-01-08 Thread adam
Hej, no właśnie niechodzi o przeniesienie do okienek tylko jeśli znasz taki program jak np fk dla dos-a to chodzi mi o taki efekt. Czyli aplikacja konsolowa z pseudo okienkami. Adam jacek pozniak wrote: > adam wrote: > >> Is in here maybe someone who speak Polish? >> >> I would like to write

Re: How do I remove/unlink wildcarded files

2015-01-08 Thread Rick Johnson
On Thursday, January 8, 2015 7:11:45 AM UTC-6, Albert van der Horst wrote: > Rick Johnson wrote: > >Widespread centralized free schooling did not exists until > >almost the 1900's. Heck, looking back at American history, > >the world *SHOULD* be in awe. To go from a rag-tag > >illiterate bunch of c

Re: Hello World

2015-01-08 Thread alister
On Thu, 08 Jan 2015 16:31:22 +0200, Marko Rauhamaa wrote: > alister : > >> On Thu, 08 Jan 2015 16:06:16 +0200, Marko Rauhamaa wrote: >>> An administrator doesn't need the users' passwords for anything but >>> should be assumed to know them. >> >> The administrator may be able to change them but h

Re: Comparisons and sorting of a numeric class....

2015-01-08 Thread Ian Kelly
On Wed, Jan 7, 2015 at 11:21 PM, Marko Rauhamaa wrote: > Steven D'Aprano : > >> Marko Rauhamaa wrote: >>> I prefer the Scheme way: >>>#f is a falsey object >>>everything else is a truthy object >> >> The Scheme way has no underlying model of what truthiness represents, just >> an arbitrary

Re: where in Nan defined

2015-01-08 Thread Jussi Piitulainen
Chris Angelico writes: > On Fri, Jan 9, 2015 at 1:37 AM, Marko Rauhamaa wrote: > > > > True, but that got me thinking: what standard Python math > > operation evaluates to NaN? > > Subtracting infinity from infinity is one easy way. > > >>> 1e309 > inf > >>> 1e309-1e309 > nan I managed to get in

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen wrote: >>>> 0*1e400 >nan Nice, that's shorter than mine. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: where in Nan defined

2015-01-08 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Ian Kelly: > > > To get nan as a literal just do: > > > > nan = float("nan") > > True, but that got me thinking: what standard Python math operation > evaluates to NaN? All manner of arithmetics gives overflow errors ("Numerical result out of range") but a literal wi

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 1:37 AM, Marko Rauhamaa wrote: > Ian Kelly : > >> To get nan as a literal just do: >> >> nan = float("nan") > > True, but that got me thinking: what standard Python math operation > evaluates to NaN? Subtracting infinity from infinity is one easy way. >>> 1e309 inf >>>

Re: Oddity with lambda and yield

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 1:30 AM, Ian Kelly wrote: > > Seems like a bug to me. http://bugs.python.org/issue23192 created with a bit more info, including disassembly. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: where in Nan defined

2015-01-08 Thread Marko Rauhamaa
Ian Kelly : > To get nan as a literal just do: > > nan = float("nan") True, but that got me thinking: what standard Python math operation evaluates to NaN? Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello World

2015-01-08 Thread Marko Rauhamaa
alister : > On Thu, 08 Jan 2015 16:06:16 +0200, Marko Rauhamaa wrote: >> An administrator doesn't need the users' passwords for anything but >> should be assumed to know them. > > The administrator may be able to change them but he should NEVER know > them (or need to)! When you are under an adm

Re: Oddity with lambda and yield

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 5:11 AM, Chris Angelico wrote: > As yield is an expression, it's legal in a lambda function, which then > means you have a generator function. But it's not quite the same as > the equivalent function made with def: > > $ python3 > Python 3.5.0a0 (default:1c51f1650c42+, Dec 2

Re: where in Nan defined

2015-01-08 Thread Chris Angelico
On Fri, Jan 9, 2015 at 1:15 AM, maurog wrote: > I'm running some pandas examples and I canno find in what module NaN is > defined. Does anyone know what module I have to import in order to have > it defined? It's simply float("nan"). If you want a name, you can give it one: NaN = float("nan") #

Re: where in Nan defined

2015-01-08 Thread Ian Kelly
On Thu, Jan 8, 2015 at 7:15 AM, maurog wrote: > I'm running some pandas examples and I canno find in what module NaN is > defined. Does anyone know what module I have to import in order to have > it defined? It's not defined anywhere. To get nan as a literal just do: nan = float("nan") -- h

Re: Hello World

2015-01-08 Thread alister
On Thu, 08 Jan 2015 16:06:16 +0200, Marko Rauhamaa wrote: > Chris Angelico : > >> With sudo, you get MUCH finer control. I can grant some user the power >> to run "sudo eject sr0", but no other commands. I can permit someone to >> execute any of a large number of commands, all individually logged

where in Nan defined

2015-01-08 Thread maurog
I'm running some pandas examples and I canno find in what module NaN is defined. Does anyone know what module I have to import in order to have it defined? -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello World

2015-01-08 Thread Michael Ströder
Chris Angelico wrote: > With sudo, you get MUCH finer control. But it's very hard, almost impossible, to really implement fine-grained control with sudo. Too many programs provide shell exits. Well, it's off-topic here. How about taking this to news:comp.security.unix ? Ciao, Michael. -- https

Re: Hello World

2015-01-08 Thread Marko Rauhamaa
Chris Angelico : > With sudo, you get MUCH finer control. I can grant some user the power > to run "sudo eject sr0", but no other commands. I can permit someone > to execute any of a large number of commands, all individually logged. I can't remember ever having a need for that. I sometimes use s

Re: Hello World

2015-01-08 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Thu, Jan 8, 2015 at 11:43 PM, Albert van der Horst > wrote: >> I don't trust sudo because it is too complicated. >> (To the point that I removed it from my machine.) >> I do >> su >> .. >> # >> su nobody >> >> Who needs sudo? > >With sudo, you get MUCH finer

Re: How do I remove/unlink wildcarded files

2015-01-08 Thread Albert van der Horst
In article , Rick Johnson wrote: >On Saturday, January 3, 2015 4:39:25 AM UTC-6, Mark Lawrence wrote: > >> I used to get very confused watching the old westerns. The child when >> talking about "more" and "paw" wasn't referring to possibly an >> adjective, noun or adverb and a part of an animal,

Re: Hello World

2015-01-08 Thread Chris Angelico
On Thu, Jan 8, 2015 at 11:43 PM, Albert van der Horst wrote: > I don't trust sudo because it is too complicated. > (To the point that I removed it from my machine.) > I do > su > .. > # > su nobody > > Who needs sudo? With sudo, you get MUCH finer control. I can grant some user the power to run "

Re: Hello World

2015-01-08 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy wrote: >> Just to be clear, writing to sys.stdout works fine in Idle. > import sys; sys.stdout.write('hello ') >> hello #2.7 >> >> In 3.4, the number of chars? bytes? is returned and written also. >> >> Whether

Oddity with lambda and yield

2015-01-08 Thread Chris Angelico
As yield is an expression, it's legal in a lambda function, which then means you have a generator function. But it's not quite the same as the equivalent function made with def: $ python3 Python 3.5.0a0 (default:1c51f1650c42+, Dec 29 2014, 02:29:06) [GCC 4.7.2] on linux Type "help", "copyright", "

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Steven D'Aprano
Christian Gollwitzer wrote: > Hi Steve, > > Am 08.01.15 um 05:35 schrieb Steven D'Aprano: >> At long last, I am pleased to announce the latest version of PyPrimes, a >> pure Python package for working with prime numbers. > > Nice. > >> PyPrimes is compatible with Python 2 and 3, and includes mu

Re: Announce: PyPrimes 0.2.1a

2015-01-08 Thread Steven D'Aprano
Ben Finney wrote: > Steven D'Aprano writes: > >> (Note: pip may have problems downloading the right version if you >> don't specify a version number.) >> >> Or you can access the latest development version: >> >> hg clone https://code.google.com/p/pyprimes/ > > The source has a ‘CHANGES.txt

Re: how to create a soap enveloppe with python suds for consume a bssv web service

2015-01-08 Thread brice DORA
Le jeudi 8 janvier 2015 07:53:12 UTC, dieter a écrit : > brice DORA writes: > > > Hi all I am working on a app in python and I have to call a web service > > deployed on JDE (bssv). I use it for the suds lib which seems pretty > > friendly. but the problem is the JDE web service that uses bssv