Re: Unexpected NANs in complex arithmetic

2016-06-21 Thread Chris Angelico
On Wed, Jun 22, 2016 at 4:17 PM, Steven D'Aprano wrote: > On Wednesday 22 June 2016 13:54, Dan Sommers wrote: > >> By the time Python returns a result for inf+3j, you're already in >> trouble (or perhaps Python is already in trouble). > > I don't see why. It is possible to do perfectly sensible ar

Re: Unexpected NANs in complex arithmetic

2016-06-21 Thread Paul Rubin
Steven D'Aprano writes: >> By the time Python returns a result for inf+3j, you're already in >> trouble (or perhaps Python is already in trouble). > I don't see why. It is possible to do perfectly sensible arithmetic on INFs. We sometimes think of the real line extended by +/- inf, or the complex

Re: Cassandra multiprocessing can't pickle _thread.lock objects

2016-06-21 Thread dieter
Daiyue Weng writes: > ... > I tried to use Cassandra and multiprocessing to insert rows (dummy data) > concurrently based on the examples in > ... > self.pool = Pool(processes=process_count, initializer=self._setup, > initargs=(session,)) > > I am wondering how to resolve the issue. "pickle" is u

Re: Operator Precedence/Boolean Logic

2016-06-21 Thread Christian Gollwitzer
Am 22.06.16 um 05:40 schrieb Elizabeth Weiss: I am a little confused as to how this is False: False==(False or True) I would think it is True because False==False is true. I think the parenthesis are confusing me. Are you thinking, by any chance, that "or" indicates a choice? Comparing Fals

Re: Can math.atan2 return INF?

2016-06-21 Thread Pierre-Alain Dorange
Steven D'Aprano wrote: > py> math.atan2(NAN, 0) > nan > > I think that the only way it will return a NAN is if passed a NAN. yes of course if you pass an invalid argument (NAN is not a real value, atan2 except coordinate x,y), the result would be invalid... -- Pierre-Alain Dorange

Re: [tkinter] widget size adjustment

2016-06-21 Thread Pierre-Alain Dorange
Rick Johnson wrote: > However, what do you expect your images to do when the > window is morphed: Stretch or Resize? Resize. The map image is a (small) portion of a virtual infitine map of the world (build throught downloading tiles images from tile map servers) : user can drag the map to see a

Re: Unexpected NANs in complex arithmetic

2016-06-21 Thread Steven D'Aprano
On Wednesday 22 June 2016 13:54, Dan Sommers wrote: > By the time Python returns a result for inf+3j, you're already in > trouble (or perhaps Python is already in trouble). I don't see why. It is possible to do perfectly sensible arithmetic on INFs. > A complex number has > a real part and an i

Re: Operator Precedence/Boolean Logic

2016-06-21 Thread Steven D'Aprano
On Wednesday 22 June 2016 13:40, Elizabeth Weiss wrote: > Hi There, > > I am a little confused as to how this is False: > > False==(False or True) > > I would think it is True because False==False is true. Remember that parentheses are always evaluated first. So Python evaluates: False or Tru

Re: while Loops

2016-06-21 Thread Michael Torrie
On 06/21/2016 09:50 PM, Elizabeth Weiss wrote: > i=1 > while i<=5: >print(i) >i=i+1 > > The result is: > 1 > 2 > 3 > 4 > 5 > > Why is one of the results 5 since i=i+1? Should the maximum result be 4 since > 4 +1=5? > > Thanks for your help! If you trace the execution through in your m

Re: while Loops

2016-06-21 Thread Ben Finney
Elizabeth Weiss writes: > Why is one of the results 5 since i=i+1? What do you think ‘i = i + 1’ means? (Asking because your idea of what that means may be affecting how you expect the loop to behave.) > Should the maximum result be 4 since 4 +1=5? Try “thinking like the computer”: perform the

Re: while Loops

2016-06-21 Thread Rustom Mody
On Wednesday, June 22, 2016 at 9:20:35 AM UTC+5:30, Elizabeth Weiss wrote: > i=1 > while i<=5: >print(i) >i=i+1 > > The result is: > 1 > 2 > 3 > 4 > 5 > > Why is one of the results 5 since i=i+1? Should the maximum result be 4 since > 4 +1=5? > Not sure what your question is But I gue

Re: while Loops

2016-06-21 Thread Wildman via Python-list
On Tue, 21 Jun 2016 20:50:24 -0700, Elizabeth Weiss wrote: > i=1 > while i<=5: >print(i) >i=i+1 > > The result is: > 1 > 2 > 3 > 4 > 5 > > Why is one of the results 5 since i=i+1? Should the maximum result be 4 since > 4 +1=5? > > Thanks for your help! The operator '<=' means less th

Re: Operator Precedence/Boolean Logic

2016-06-21 Thread Ben Finney
Elizabeth Weiss writes: > Hi There, Welcome! Your questions are fine here, but you may like to know that we also have a beginner-specific forum for collaborative tutoring https://mail.python.org/mailman/listinfo/tutor>. > I am a little confused as to how this is False: > False==(False or True)

while Loops

2016-06-21 Thread Elizabeth Weiss
i=1 while i<=5: print(i) i=i+1 The result is: 1 2 3 4 5 Why is one of the results 5 since i=i+1? Should the maximum result be 4 since 4 +1=5? Thanks for your help! -- https://mail.python.org/mailman/listinfo/python-list

Re: Unexpected NANs in complex arithmetic

2016-06-21 Thread Dan Sommers
On Wed, 22 Jun 2016 12:57:55 +1000, Chris Angelico wrote: > On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano wrote: >> I'm doing some arithmetic on complex numbers involving INFs, and getting >> unexpected NANs. >> >> py> INF = float('inf') >> py> z = INF + 3j >> py> z >> (inf+3j) [...] >> Is

Operator Precedence/Boolean Logic

2016-06-21 Thread Elizabeth Weiss
Hi There, I am a little confused as to how this is False: False==(False or True) I would think it is True because False==False is true. I think the parenthesis are confusing me. (False==False) or True This is True. Is it because False==False? And True==False is not True but that does not

Re: Unexpected NANs in complex arithmetic

2016-06-21 Thread Chris Angelico
On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano wrote: > I'm doing some arithmetic on complex numbers involving INFs, and getting > unexpected NANs. > > py> INF = float('inf') > py> z = INF + 3j > py> z > (inf+3j) > py> -z > (-inf-3j) > > So far, nothing unexpected has occurred. But: > > py> -1*

Unexpected NANs in complex arithmetic

2016-06-21 Thread Steven D'Aprano
I'm doing some arithmetic on complex numbers involving INFs, and getting unexpected NANs. py> INF = float('inf') py> z = INF + 3j py> z (inf+3j) py> -z (-inf-3j) So far, nothing unexpected has occurred. But: py> -1*z # should be the same as -z (-inf+nanj) And even more strange: py> 1*z (inf+

Re: Can math.atan2 return INF?

2016-06-21 Thread Steven D'Aprano
On Wed, 22 Jun 2016 04:32 am, Jussi Piitulainen wrote: > pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes: > >> Steven D'Aprano wrote: >> >>> Are there any circumstances where math.atan2(a, b) can return an >>> infinity? [...] > I didn't see any mention of it ever being infinite,

Re: Can math.atan2 return INF?

2016-06-21 Thread Steven D'Aprano
On Wed, 22 Jun 2016 04:01 am, Pierre-Alain Dorange wrote: > Steven D'Aprano wrote: > >> Are there any circumstances where math.atan2(a, b) can return an >> infinity? >> >> I know it will return a NAN under some circumstances. > > atan or atan2 can't return INFINITE, it was the arc tangent of a

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-21 Thread jfong
Pushpanth Gundepalli at 2016/6/21 7:03:28PM wrote: > Guys, can you please share me some sites where we can practice python > programs for beginners and Intermediate. Is this you want? http://pythontutor.com/ --Jach -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Steven D'Aprano
On Tue, 21 Jun 2016 05:34 pm, Ari Freund wrote: > I'd like to run this idea by the community to see if it's PEP worthy and > hasn't been already rejected. > > Background > Just as keyword arguments enhance code readability and diminish the risk > of bugs, so too would named > return values. I do

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 6:16:09 PM UTC-5, BartC wrote: > On 21/06/2016 23:20, Rick Johnson wrote: > > On Tuesday, June 21, 2016 at 12:15:38 PM UTC-5, Random832 wrote: > > > Storing dynamic data to global space is almost always > > foolish, and I'm a fan of name spaces. But i did not > > recom

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 5:20:53 PM UTC-5, Rick Johnson wrote: > py> import sys > py> def foo(): > ... print 'My name is Foo!' > py> sys.modules['__builtin__'].__dict__['foo_func'] = foo > py> foo() > My name is Foo! > py> foo = 'bar' > py> foo > 'bar' >

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 5:32:43 PM UTC-5, Chris Angelico wrote: > On Wed, Jun 22, 2016 at 8:20 AM, Rick Johnson: > > Then one could have added module-level symbols without all > > the semantic hubbub. > > > > MSFL.foo = 0 > > > > def iter_foo(): > > MSFL.foo += 1 > > > > And d

Re: the global keyword:

2016-06-21 Thread BartC
On 21/06/2016 23:20, Rick Johnson wrote: On Tuesday, June 21, 2016 at 12:15:38 PM UTC-5, Random832 wrote: Storing dynamic data to global space is almost always foolish, and I'm a fan of name spaces. But i did not recommend such foolish action, i was merely replying to the assertion that "Pytho

Re: the global keyword:

2016-06-21 Thread Chris Angelico
On Wed, Jun 22, 2016 at 8:20 AM, Rick Johnson wrote: > Then one could have added module-level symbols without all > the semantic hubbub. > > MSFL.foo = 0 > > def iter_foo(): > MSFL.foo += 1 > And don't forget that you would need to call this function as MSFL.iter_foo(). Module-lev

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 12:15:38 PM UTC-5, Random832 wrote: > You can put a function or constant there, sure. But if > you're using it as a variable, you'd have to do that > *every* time (in which case what's the point) Well, since the term "variable" has been so abused, using it in such a n

Re: [tkinter] widget size adjustment

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 12:24:56 PM UTC-5, Pierre-Alain Dorange wrote: > > > (3) Or perhaps you want the canvas content(s) to resize > > dynamically as the canvas expands and contacts? > > That is more close to my needs. > > A picture is often better than words, here is a scren > capture of my

pyinstaller

2016-06-21 Thread Larry Martell
Anyone here have any experience with pyinstaller? I am trying to use it, but I'm not having much success. I tried posting to the pyinstaller ML but it said my post had to be approved first, and that hasn't happened in a while. I'll post details if someone here thinks they can help. -- https://mail

Re: [tkinter] widget size adjustment

2016-06-21 Thread Christian Gollwitzer
Am 21.06.16 um 19:24 schrieb Pierre-Alain Dorange: A picture is often better than words, here is a scren capture of my apps before and after resing the main window : It was a map viewer similar to online javascript mapviewer but in a loca

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Marko Rauhamaa
Tim Chase : > I have a ~/.XCompose file that contains something like My Fedora 23 setup has === BEGIN /etc/X11/xinit/xinitrc-common= [...] userxkbmap=$HOME/.Xkbmap [...] if [ -r "$userxkbmap" ]; then setxkbmap $(cat "$userxkbmap") XKB_IN_USE=yes fi [...] =

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Tim Chase
On 2016-06-21 21:56, Marko Rauhamaa wrote: > Rustom Mody : > > > Regarding xkb: > > > > Some good advice given to me by Yuri Khan on emacs list > > https://lists.gnu.org/archive/html/help-gnu-emacs/2015-01/msg00332.html > > Well, not quite: > >* Find the XKB data directory. [Normally, this >

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Chris Angelico
On Wed, Jun 22, 2016 at 4:30 AM, Tal Zion wrote: > We use CPython's implementation of exec and eval. > (Please don't keep top-posting.) Okay. So as I understand it, this requires the full CPython interpreter to be included at run-time; how does this help you work seamlessly with other languages?

Re: Marking a subtest as an expected failure

2016-06-21 Thread Ben Finney
Steven D'Aprano writes: > def test_spam(self): > for i in range(100): > for j in range(100): > with self.subtest(i=i, j=j): > if (i, j) != (97, 83): > self.assertEqual(spam(i, j), 999) > > > but is there a nicer way to mark a specific su

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Marko Rauhamaa
Rustom Mody : > Regarding xkb: > > Some good advice given to me by Yuri Khan on emacs list > https://lists.gnu.org/archive/html/help-gnu-emacs/2015-01/msg00332.html Well, not quite: * Find the XKB data directory. [Normally, this is /usr/share/X11/xkb.] * In its “keycodes” subdirectory, cre

Re: Can math.atan2 return INF?

2016-06-21 Thread Jussi Piitulainen
pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes: > Steven D'Aprano wrote: > >> Are there any circumstances where math.atan2(a, b) can return an infinity? >> >> I know it will return a NAN under some circumstances. > > atan or atan2 can't return INFINITE, it was the arc tangent of

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Tal Zion
We use CPython's implementation of exec and eval. Tal On 06/21/2016 09:26 PM, Chris Angelico wrote: On Wed, Jun 22, 2016 at 4:01 AM, Tal Zion wrote: Bridge compiles Python modules into native code, which requires us to support Python *language* features (for, while, class, generators, etc) bu

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Chris Angelico
On Wed, Jun 22, 2016 at 4:01 AM, Tal Zion wrote: > Bridge compiles Python modules into native code, which requires us to > support Python *language* features (for, while, class, generators, etc) but > it reuses CPython's libraries (list, dict, str, etc) so we don't implement > those, and it also u

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Tal Zion
Bridge compiles Python modules into native code, which requires us to support Python *language* features (for, while, class, generators, etc) but it reuses CPython's libraries (list, dict, str, etc) so we don't implement those, and it also uses CPython's ast module in order to parse Python code

Re: Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Michael Selik
On Tue, Jun 21, 2016, 10:14 AM Terry Reedy wrote: > On 6/21/2016 3:34 AM, Ari Freund via Python-list wrote: > > I'd like to run this idea by the community to see if it's PEP worthy and > > hasn't been already rejected. > > > There was a recent (last couple of months?) discussion on python-ideas >

Re: Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread MRAB
On 2016-06-21 18:12, Terry Reedy wrote: On 6/21/2016 3:34 AM, Ari Freund via Python-list wrote: I'd like to run this idea by the community to see if it's PEP worthy and hasn't been already rejected. Background Just as keyword arguments enhance code readability and diminish the risk of bugs, so

RE: Cassandra multiprocessing can't pickle _thread.lock objects

2016-06-21 Thread Joaquin Alzola
>I tried to use Cassandra and multiprocessing to insert rows (dummy data) >concurrently based on the examples in Same situation here. I was going to try this solution but on the reading side. Was even thinking of putting Spark-Cassandra just to avoid Python to do multiprocessing. This email is c

Re: Request for opinions: A cross language development tool

2016-06-21 Thread BartC
On 21/06/2016 15:06, Tal Zion wrote: * Bridge makes Python faster: Python code compiled through Bridge is compiled to native code. Because we are leveraging LLVM's many optimizations, Python code will run faster than ever. In that case forget any of your other claims. Making any Python code f

Re: Can math.atan2 return INF?

2016-06-21 Thread Pierre-Alain Dorange
Steven D'Aprano wrote: > Are there any circumstances where math.atan2(a, b) can return an infinity? > > I know it will return a NAN under some circumstances. atan or atan2 can't return INFINITE, it was the arc tangent of a value, then arc tangent can only be between -PI and +PI (is was an angle

Can math.atan2 return INF?

2016-06-21 Thread Steven D'Aprano
Are there any circumstances where math.atan2(a, b) can return an infinity? I know it will return a NAN under some circumstances. -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Chris Angelico
On Wed, Jun 22, 2016 at 12:06 AM, Tal Zion wrote: > * Bridge makes Python faster: Python code compiled through Bridge is > compiled to native code. Because we are leveraging LLVM's many > optimizations, Python code will run faster than ever. Can you run *any* Python program through Bridge? Absolu

Re: the global keyword:

2016-06-21 Thread Random832
On Tue, Jun 21, 2016, at 13:04, Rick Johnson wrote: > On Sunday, June 12, 2016 at 2:08:01 PM UTC-5, BartC wrote: > > Anyway, it shows Python doesn't have true cross-module globals. > > BS! You can inject symbols into sys.modules and achieve a > true global. You can put a function or constant th

Re: [tkinter] widget size adjustment

2016-06-21 Thread Pierre-Alain Dorange
Rick Johnson wrote: > I'm sorry, but your explanation is lacking, and could be > the reason you have not received help so far. Yes you're probably right. For my excuse i'm french and if i read english, i'm not fluent with it for writing... > I'll attempt > to guess what the problem is, and then

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 6:03:28 AM UTC-5, Pushpanth Gundepalli wrote: > Guys, can you please share me some sites where we can practice python > programs for beginners and Intermediate. Have you tried googling for "python interactive tutorial"? Someone had created one similar to Ruby's, but

Re: Bulk Adding Methods Pythonically

2016-06-21 Thread Rob Gaddi
Steven D'Aprano wrote: > On Thu, 16 Jun 2016 04:39 am, Rob Gaddi wrote: > >>> class Channel: >>> frequency = mkmeasure('frequency', 'FREQ') >>> falltime = mkmeasure('falltime', 'FTIM') >> >> Thought about it, but whenever I'm dropping 20-someodd of those there's >> inevitably some place where I s

Re: Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Terry Reedy
On 6/21/2016 3:34 AM, Ari Freund via Python-list wrote: I'd like to run this idea by the community to see if it's PEP worthy and hasn't been already rejected. Background Just as keyword arguments enhance code readability and diminish the risk of bugs, so too would named return values. Currently

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Sunday, June 12, 2016 at 2:08:01 PM UTC-5, BartC wrote: > Anyway, it shows Python doesn't have true cross-module globals. BS! You can inject symbols into sys.modules and achieve a true global. ## BEGIN: INTERACTIVE SESSION ## py> import sys py> def foo(): ... print 'My name

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Michael Torrie
On 06/21/2016 06:10 AM, Tal Zion wrote: > So how does this magic work? We developed a new compiler platform called > Bridge. At the heart of Bridge is the Bridge Extensible Code > Representation (BECR). Code in any language is parsed into an AST and is > then translated to the BECR. The BECR sup

Re: [tkinter] widget size adjustment

2016-06-21 Thread Rick Johnson
On Sunday, June 19, 2016 at 1:29:11 PM UTC-5, Pierre-Alain Dorange wrote: > I got a small interface handle with tkinter / Gridmanager. > I configure row and column to follow user window size > adjustement, that' fine. but i do not know how to adjust > the main widget : a canvas displaying a portion

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Steven D'Aprano
On Tue, 21 Jun 2016 10:10 pm, Tal Zion wrote: > * > > Hey! > > I would like to know your opinions about a project a friend and I have > been developing for about a year now, which we really think could > empower Python. Today Python is mostly used on servers. Really? > Many people who > want

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Tim Chase
On 2016-06-21 11:35, Marko Rauhamaa wrote: > > These are all pretty easy to remember. > > German umlauts a" o" u" give ä ö ü (or use uppercase) > > Spanish eña (spelling?) and punctuations: n~ ?? !! --> ñ ¿ ¡ > > French accents: e' e` e^ c, --> é è ê ç > > Money: c= l- y- c/ --> € £ ¥ ¢ >

Re: (repost) Advisory: HTTP Header Injection in Python urllib

2016-06-21 Thread Jon Ribbens
On 2016-06-21, Steven D'Aprano wrote: > "In our case, if we could fool an internal Python application into fetching > a URL for us, then we could easily access memcached instances. Consider the > URL: ..." > > and then they demonstrate an attack against memcache. Except, the author of > the articl

Re: base64.b64encode(data)

2016-06-21 Thread Steven D'Aprano
On Mon, 13 Jun 2016 11:36 pm, Random832 wrote: > On Mon, Jun 13, 2016, at 06:35, Steven D'Aprano wrote: >> But this is a Python forum, and Python 3 is a language that tries >> very, very hard to keep a clean separation between bytes and text, > > Yes, but that doesn't mean that you're right As

Re: (repost) Advisory: HTTP Header Injection in Python urllib

2016-06-21 Thread Steven D'Aprano
On Sun, 19 Jun 2016 03:28 am, Random832 wrote: > On Sat, Jun 18, 2016, at 12:02, Steven D'Aprano wrote: >> Er, you may have missed that I'm talking about a single user setup. >> Are you suggesting that I can't trust myself not to forge a request >> that goes to a hostile site? >> >> It's all well

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Rustom Mody
On Tuesday, June 21, 2016 at 6:38:19 PM UTC+5:30, Marko Rauhamaa wrote: > A coworker of mine went through the trouble of doing the xmodmap > equivalent with setxkbmap. Thought of interviewing him about it one day. > > How-to's are really hard to come by: > >https://wiki.archlinux.org/index.ph

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Rustom Mody
On Tuesday, June 21, 2016 at 7:27:00 PM UTC+5:30, Rustom Mody wrote: > Emacs: : > Math: So far Ive used tex input method -- Not satisfactory After "Random832" pointed me to RFC1345 I checked that emacs has an RFC1345 input method. It may be nicer than tex input method -- need to check However like

Cassandra multiprocessing can't pickle _thread.lock objects

2016-06-21 Thread Daiyue Weng
I tried to use Cassandra and multiprocessing to insert rows (dummy data) concurrently based on the examples in http://www.datastax.com/dev/blog/datastax-python-driver-multiprocessing-example-for-improved-bulk-data-throughput This is my code class QueryManager(object): concurrency = 100 # chose

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Tal Zion
On 06/21/2016 03:39 PM, Christian Gollwitzer wrote: Am 21.06.16 um 14:10 schrieb Tal Zion: develop frontends in Java, Swift, Javascript, etc. > So how does this magic work? We developed a new compiler platform called Bridge. At the heart of Bridge is the Bridge Extensible Code Representation (

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Rustom Mody
On Tuesday, June 21, 2016 at 6:38:19 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody : > > > On Tuesday, June 21, 2016 at 2:05:55 PM UTC+5:30, Marko Rauhamaa wrote: > >> (On the other hand, I have always specified my preferred keyboard > >> layout with .Xmodmap.) > > > > If this is being given as

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Marko Rauhamaa
Rustom Mody : > On Tuesday, June 21, 2016 at 2:05:55 PM UTC+5:30, Marko Rauhamaa wrote: >> (On the other hand, I have always specified my preferred keyboard >> layout with .Xmodmap.) > > If this is being given as advice I never gave it as advice. > its bad advice xmodmap is obsolete use xkb A c

Re: value of pi and 22/7

2016-06-21 Thread Gregory Ewing
Marko Rauhamaa wrote: And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about. [1 Kings 7:23] I think I know how that came about. It was actually filled with molt

Re: Request for opinions: A cross language development tool

2016-06-21 Thread Christian Gollwitzer
Am 21.06.16 um 14:10 schrieb Tal Zion: develop frontends in Java, Swift, Javascript, etc. > So how does this magic work? We developed a new compiler platform called Bridge. At the heart of Bridge is the Bridge Extensible Code Representation (BECR). Code in any language is parsed into an AST and

Request for opinions: A cross language development tool

2016-06-21 Thread Tal Zion
* Hey! I would like to know your opinions about a project a friend and I have been developing for about a year now, which we really think could empower Python. Today Python is mostly used on servers. Many people who want to develop an app will choose Python to write the backend and develop f

Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-21 Thread Pushpanth Gundepalli
Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate. -- https://mail.python.org/mailman/listinfo/python-list

Re: the global keyword:

2016-06-21 Thread Antoon Pardon
Op 21-06-16 om 12:41 schreef BartC: > On 21/06/2016 09:08, Antoon Pardon wrote: >> Op 20-06-16 om 16:53 schreef Steven D'Aprano: > >>> You know, there's not actually a rule or law that says you have to >>> automatically take the contrary position to everything I say. >> >> There is also not a rule

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Rustom Mody
On Tuesday, June 21, 2016 at 2:05:55 PM UTC+5:30, Marko Rauhamaa wrote: > Larry Hudson : > > It sounds like you are almost, but not quite, describing the Linux > > Compose key. > > I have used Linux since the 1990's but don't know anything about "the > Linux Compose key." It used to be a real (a

Re: the global keyword:

2016-06-21 Thread BartC
On 21/06/2016 09:08, Antoon Pardon wrote: Op 20-06-16 om 16:53 schreef Steven D'Aprano: You know, there's not actually a rule or law that says you have to automatically take the contrary position to everything I say. There is also not a rule of law that says you have to automatically introdu

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Marko Rauhamaa
Larry Hudson : > It sounds like you are almost, but not quite, describing the Linux > Compose key. I have used Linux since the 1990's but don't know anything about "the Linux Compose key." (On the other hand, I have always specified my preferred keyboard layout with .Xmodmap.) > These are all pre

Re: value of pi and 22/7

2016-06-21 Thread Steven D'Aprano
On Tuesday 21 June 2016 02:01, Ian Kelly wrote: > On Mon, Jun 20, 2016 at 12:22 AM, Steven D'Aprano > wrote: >> There's a difference though. Nobody has tried to legislate the value of pi >> to match your casual reference to "about 1900 square feet", but there's been >> at least one serious attemp

Marking a subtest as an expected failure

2016-06-21 Thread Steven D'Aprano
I'm using unittest and the subtest context manager to run some tests: def test_spam(self): for i in range(100): for j in range(100): with self.subtest(i=i, j=j): self.assertEqual(spam(i, j), 999) Now, it turns out that spam(i, j) == 999 for all i, j *exce

Re: the global keyword:

2016-06-21 Thread Antoon Pardon
Op 20-06-16 om 16:53 schreef Steven D'Aprano: > On Mon, 20 Jun 2016 11:29 pm, Random832 wrote: > >> On Mon, Jun 20, 2016, at 08:15, Steven D'Aprano wrote: >>> Bart didn't say anyone had defended it. He made an observation: >>> >>> "that's a good illustration of why 'y' isn't a name reference to 'x'

Re: is there a concurrent list for append in parallel programming in python? how to pass parameter in this parallel program with pool?

2016-06-21 Thread Ian Kelly
On Thu, Jun 16, 2016 at 2:45 AM, meInvent bbird wrote: > the name in c# is not called concurrent list, it is called > blockingcollection > > dictionary called concurrent dictionary > > thread safe these kind of things > > https://msdn.microsoft.com/en-us/library/dd267312(v=vs.110).aspx > > https:/

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Larry Hudson via Python-list
On 06/19/2016 08:29 PM, Steven D'Aprano wrote: On Mon, 20 Jun 2016 12:07 pm, Rustom Mody wrote: [snip] In theory most Linux apps support an X mechanism for inserting characters that don't appear on the keyboard. Unfortunately, this gives no feedback when you get it wrong, and discoverablity is

Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Ari Freund via Python-list
I'd like to run this idea by the community to see if it's PEP worthy and hasn't been already rejected. Background Just as keyword arguments enhance code readability and diminish the risk of bugs, so too would named return values. Currently, we can write val1, val2, val3 = myfunc() but we must