Re: [Tutor] Using the Nimblenet Library in Python 3.6
On 05/04/18 04:02, Mark Lawrence wrote: > Python 3.6 has more functionality than 2.7 by definition, but your > comment implies, at least to me, that 2.7 and 3.6 are chalk and cheese. > Nothing could be further from the truth and has regrettably been one of > the reasons for the dreadfully slow uptake of Python 3. I disagree. Apart from the superficial language compatibility issues, which 2.7 can partially address by importing from future, the libraries are dramatically different. Any non trivial program runs into issues the minute it starts importing modules. module names are different, function names within those modules are different, return values and parameter types are different. Given Python programming relies hugely on the modules in the standard library I find it impossible to produce code that works across 2.7 and 3.x without significant effort to force compatibility. That's why tools like six etc exist. You may have been luckier than me but in my experience the gap between the two versions is significant and not to be underestimated. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Using the Nimblenet Library in Python 3.6
On 05/04/18 09:39, Alan Gauld via Tutor wrote: On 05/04/18 04:02, Mark Lawrence wrote: Python 3.6 has more functionality than 2.7 by definition, but your comment implies, at least to me, that 2.7 and 3.6 are chalk and cheese. Nothing could be further from the truth and has regrettably been one of the reasons for the dreadfully slow uptake of Python 3. I disagree. Apart from the superficial language compatibility issues, which 2.7 can partially address by importing from future, the libraries are dramatically different. Any non trivial program runs into issues the minute it starts importing modules. module names are different, function names within those modules are different, return values and parameter types are different. Given Python programming relies hugely on the modules in the standard library I find it impossible to produce code that works across 2.7 and 3.x without significant effort to force compatibility. That's why tools like six etc exist. You may have been luckier than me but in my experience the gap between the two versions is significant and not to be underestimated. Mountains out of molehills. I suggest that you give up programming. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Using the Nimblenet Library in Python 3.6
On Thu, Apr 5, 2018 at 3:39 AM, Alan Gauld via Tutor wrote: > On 05/04/18 04:02, Mark Lawrence wrote: > >> Python 3.6 has more functionality than 2.7 by definition, but your >> comment implies, at least to me, that 2.7 and 3.6 are chalk and cheese. >> Nothing could be further from the truth and has regrettably been one of >> the reasons for the dreadfully slow uptake of Python 3. > > I disagree. Apart from the superficial language compatibility issues, > which 2.7 can partially address by importing from future, the libraries > are dramatically different. Any non trivial program runs into issues the > minute it starts importing modules. module names are different, function > names within those modules are different, return values and parameter > types are different. > > Given Python programming relies hugely on the modules in the standard > library I find it impossible to produce code that works across 2.7 > and 3.x without significant effort to force compatibility. That's why > tools like six etc exist. > > You may have been luckier than me but in my experience the gap > between the two versions is significant and not to be underestimated. I would appreciate keeping the FUD about the differences to a minimum :). The differences are there and they are significant, but far from insurmountable; in my experience, well-written Python 3 code is fairly trivial to port to Python 2/3. Depending on the quality of the initial Python 2 code, it's not quite as easy to port from 2 to 2/3 or directly to 3 due to Unicode/bytes confusion (made worse if the Python 2 code relies on bad Unicode practices), but they're still very much the same language. However, it does take some effort to port an established Python 2 codebase to Python 3, and to bring the thread back to the original topic, it looks like the author of the package in question is not particularly open to doing the work for their package (but may accept a pull request!). Christine (OP), you may have some luck with opening an issue at https://github.com/jorgenkg/python-neural-network and requesting Python 3 support. I don't have enough experience in the field of machine learning to competently suggest an alternative, but I've heard good things about TensorFlow. -- Zach ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Using the Nimblenet Library in Python 3.6
On 05/04/18 15:28, Zachary Ware wrote: > I would appreciate keeping the FUD about the differences to a minimum > :). The differences are there and they are significant, but far from > insurmountable; in my experience, well-written Python 3 code is fairly > trivial to port to Python 2/3. I agree but we were speaking in the context of the OP who wanted to use a module written for 2.7 within 3.6. I stated that was unlikely to work because the differences in versions were significant. It is non trivial but not difficult to port code from one version to another. It is very much more effort to produce a single code base that works with both v2 and v3. And that was the context in which my comments should be taken. Speaking personally I write almost all my new code for v3 and keep my old code at v2. I have ported a few projects to v3. I have only written 2 projects that work on both versions and they were painful to do. That was what I was talking about in my response to Mark. It's not a reasonable thing to expect a module written for v2 to work in v3, it's too much work for most authors. They might consider porting it to v3 if they are not busy with other things but trying to build for dual versions is no fun at all. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor