On 2018-08-31, Terry Reedy wrote:
> That said, some people will continue to use existing python 2 code for a
> decade or more.
People like me. I do a lot of serial and network protocol handling in
Python, and the changes to the handling of bytes vs. strings in Python
3 means that sort of thing
On 31/08/18 06:33, Stone Zhong wrote:
On Thursday, August 30, 2018 at 10:19:34 PM UTC-7, Terry Reedy wrote:
On 8/30/2018 10:27 PM, Stone Zhong wrote:
Hi there,
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to pyt
On 31/08/18 04:27, Stone Zhong wrote:
Hi there,
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in the
On Fri, Aug 31, 2018 at 3:50 PM, Cameron Simpson wrote:
> And aim for Python 2.7 - this goes a long way to making 2 and 3 easy to work
> with. The fursther back you go in 2.x the harder it gets.
Yep; also, aim for 3.5+, since you get the ability to write u"..."
(from 3.3) and b"..."%... (from 3.5
On 30Aug2018 19:27, Stone Zhong wrote:
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in the future f
On Thursday, August 30, 2018 at 10:19:34 PM UTC-7, Terry Reedy wrote:
> On 8/30/2018 10:27 PM, Stone Zhong wrote:
> > Hi there,
> >
> > I think the fact is:
> > - There are still considerable amount of people still using python2
> > - Python2 user will eventually upgrade to python3
> >
> > So any
On 8/30/2018 10:27 PM, Stone Zhong wrote:
Hi there,
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in
Hi there,
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in the future for python3 user. So I suppose a
_compiling
and that is basically a package name starts with python2/3-*package-name*.
But in RHEL or Centos, we have some packages named:
python-*package-name*, *package-name*-python and so on,
one example is libselinux, which in Fedora is:
python2/3-libselinux and on Centos\RHEL is libselinux-pyth
Chris Angelico wrote:
> On Thu, Aug 4, 2011 at 4:01 AM, Steven D'Aprano
> wrote:
>> a, b = divmod(n, i)
>> if b == 0:
>> total += a+i
>>
>
> Wouldn't this fail on squares? It happens to give correct results as
> far as I've checked; no square up to 10,000 is called perfect, and
> there are no pe
On Thu, Aug 4, 2011 at 4:01 AM, Steven D'Aprano
wrote:
> a, b = divmod(n, i)
> if b == 0:
> total += a+i
>
Wouldn't this fail on squares? It happens to give correct results as
far as I've checked; no square up to 10,000 is called perfect, and
there are no perfect squares
harrismh777 wrote:
> def perf(n):
> sum = 0
> for i in range(1, n):
> if n % i == 0:
> sum += i
> return sum == n
A more effective way to speed that up is with a better algorithm:
def isperfect(n):
if n < 2: return False
total = 1
for i in range(
On Tue, Aug 2, 2011 at 3:45 PM, Steven D'Aprano
wrote:
> (But don't make the mistake of doing what I did, which was to attempt to
> produce range(29000) in Python 2. After multiple *hours* of swapping, I
> was finally able to kill the Python process and get control of my PC again.
> Sigh.)
>
harrismh777 wrote:
> The following is intended as a helpful small extension to the xrange()
> range() discussion brought up this past weekend by Billy Mays...
>
> With Python2 you basically have two ways to get a range of numbers:
> range() , which returns a list, and
>xrange() , which r
On Tue, Aug 2, 2011 at 10:05 AM, Peter Otten <__pete...@web.de> wrote:
> i/2 returns a float in Python 3; you should use i//2 for consistency.
>
And I forgot to make this change before doing my tests. Redoing the
Python 3 ones with // quite drastically changes things!
3.2 (r32:88445, Feb 20 2011,
On Tue, Aug 2, 2011 at 10:20 AM, Stefan Behnel wrote:
> What version of Py3 were you using? If you used the latest, maybe even the
> latest hg version, you will notice that that's substantially faster for
> integers than, e.g. 3.1.x.
>
I just tried this out, using a slightly modified script but t
Am 02.08.2011 09:12 schrieb harrismh777:
The following is intended as a helpful small extension to the xrange()
range() discussion brought up this past weekend by Billy Mays...
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , whic
harrismh777, 02.08.2011 09:12:
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , which returns an iterator.
With Python3 you must use range(), which produces an iterator; while
xrange() does not exist at all (at least not on 3.2).
harrismh777 wrote:
> The following is intended as a helpful small extension to the xrange()
> range() discussion brought up this past weekend by Billy Mays...
>
> With Python2 you basically have two ways to get a range of numbers:
> range() , which returns a list, and
>xrange() , which r
harrismh777 wrote:
these will run on either Python2 or
> Python3... except that if you substitute xrange() for range() for
> Python2 they will throw an exception on Python3... doh.
if 'xrange' not in dir(__builtins__):
xrange = range
at the beginning of your program will fix that.
--
The following is intended as a helpful small extension to the xrange()
range() discussion brought up this past weekend by Billy Mays...
With Python2 you basically have two ways to get a range of numbers:
range() , which returns a list, and
xrange() , which returns an iterator.
With Python
On Thu, 19 May 2011 05:42:29 -0700, lkcl wrote:
> has anyone considered the idea of literally creating a Python2/
> subdirectory in the python3 codebase, literally just dropping the entire
> python2.N code directly into it, renaming all functions and data
> structures, adding a "--2-compatible" s
[changing subject, seems a good idea...]
On May 19, 2:13 am, Terry Reedy wrote:
> On 5/18/2011 9:42 AM, lkcl wrote:
>
> > he's got a good point, terry. breaking backwards-compatibility was a
> > completely mad and incomprehensible decision.
>
> I see that I should take everything you (or Harri
23 matches
Mail list logo