Re: Announcement: TLSv1.2 will become mandatory in the future for Python.org Sites

2017-01-10 Thread Donald Stufft

> On Jan 10, 2017, at 9:59 AM, Oleg Broytman  wrote:
> 
> On Tue, Jan 10, 2017 at 08:27:21AM -0500, Donald Stufft  
> wrote:
>>python3 -c "import urllib.request,json; 
>> print(json.loads(urllib.request.urlopen('https://www.howsmyssl.com/a/check').read())['tls_version'])"
> 
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
>s.__class__.__name__))
> TypeError: the JSON object must be str, not ‘bytes'
> 


Huh, just tested, my original snippet works on Python 3.6 but fails on Python 
3.5. 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-10 Thread Donald Stufft

> On Dec 10, 2014, at 11:59 AM, Bruno Cauet  wrote:
> 
> Hi all,
> Last year a survey was conducted on python 2 and 3 usage.
> Here is the 2014 edition, slightly updated (from 9 to 11 questions).
> It should not take you more than 1 minute to fill. I would be pleased if you 
> took that time.
> 
> Here's the url: http://goo.gl/forms/tDTcm8UzB3 
> <http://goo.gl/forms/tDTcm8UzB3>
> I'll publish the results around the end of the year.
> 
> Last year results: https://wiki.python.org/moin/2.x-vs-3.x-survey 
> <https://wiki.python.org/moin/2.x-vs-3.x-survey>

Just going to say http://d.stufft.io/image/0z1841112o0C 
<http://d.stufft.io/image/0z1841112o0C> is a hard question to answer, since 
most code I write is both.

---
Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Donald Stufft

> On Nov 7, 2014, at 10:46 AM, Paul Moore  wrote:
> 
> I'm in the process of developing an automated solution to allow users
> to quickly set up a Windows box so that it can be used to compile
> Python extensions and build wheels. While it can obviously be used by
> Windows developers who want to quickly set up a box, my main target is
> Unix developers who want to provide wheels for Windows users.
> 
> To that end, I'd like to get an idea of what sort of access to Windows
> a typical Unix developer would have. I'm particularly interested in
> whether Windows XP/Vista is still in use, and whether you're likely to
> already have Python and/or any development tools installed. Ideally, a
> clean Windows 7 or later virtual machine is the best environment, but
> I don't know if it's reasonable to assume that.
> 
> Another alternative is to have an Amazon EC2 AMI prebuilt, and users
> can just create an instance based on it. That seems pretty easy to do
> from my perspective but I don't know if the connectivity process
> (remote desktop) is a problem for Unix developers.
> 
> Any feedback would be extremely useful. I'm at a point where I can
> pretty easily set up any of these options, but if they don't turn out
> to actually be usable by the target audience, it's a bit of a waste of
> time! :-)
> 
> Thanks,
> Paul
> ___
> Distutils-SIG maillist  -  distutils-...@python.org
> https://mail.python.org/mailman/listinfo/distutils-sig

As an *nix user I have a Windows 7 VM on my OS X machine that I can also
dual boot into which I mostly use for playing games that won’t play on
my OS X box natively. It does not have Python or any development tooling
installed on it.

I also have access to the cloud(tm) which is where I normally spin up
a whatever-the-most-recent-looking-name Windows Server.

---
Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a unique method in python to unique a list?

2012-09-08 Thread Donald Stufft
For a short list the difference is going to be negligible. 

For a long list the difference is that checking if an item in a list requires 
iterating over the list internally to find it but checking if an item is inside 
of a set uses a faster method that doesn't require iterating over the list. 
This doesn't matter if you have 20 or 30 items, but imagine if instead you have 
50 million items. Your going to be iterating over the list a lot and that can 
introduce significant slow dow.

On the other hand using a set is faster in that case, but because you are 
storing an additional copy of the data you are using more memory to store extra 
copies of everything. 


On Sunday, September 9, 2012 at 2:31 AM, John H. Li wrote:

> Thanks first, I could understand the second approach easily. The first 
> approach is  a bit puzzling. Why are  seen=set() and seen.add(x)  still 
> necessary there if we can use unique.append(x) alone? Thanks for your 
> enlightenment.
> 
> On Sun, Sep 9, 2012 at 1:59 PM, Donald Stufft  (mailto:donald.stu...@gmail.com)> wrote:
> > seen = set() 
> > uniqued = []
> > for x in original:
> > if not x in seen:
> > seen.add(x)
> > uniqued.append(x)
> > 
> > or
> > 
> > uniqued = []
> > for x in oriignal:
> > if not x in uniqued:
> > uniqued.append(x)
> > 
> > The difference between is option #1 is more efficient speed wise, but uses 
> > more memory (extraneous set hanging around), whereas the second is slower 
> > (``in`` is slower in lists than in sets) but uses less memory. 
> > 
> > On Sunday, September 9, 2012 at 1:56 AM, John H. Li wrote:
> > 
> > > Many thanks. If I want keep the order, how can I deal with it?
> > > or we can list(set([1, 1, 2, 3, 4])) = [1,2,3,4]
> > > 
> > > 
> > > On Sun, Sep 9, 2012 at 1:47 PM, Donald Stufft  > > (mailto:donald.stu...@gmail.com)> wrote:
> > > > If you don't need to retain order you can just use a set, 
> > > > 
> > > > set([1, 1, 2, 3, 4]) = set([1, 2, 3, 4])
> > > > 
> > > > But set's don't retain order. 
> > > > 
> > > > On Sunday, September 9, 2012 at 1:43 AM, Token Type wrote:
> > > > 
> > > > > Is there a unique method in python to unique a list? thanks
> > > > > -- 
> > > > > http://mail.python.org/mailman/listinfo/python-list
> > > > > 
> > > > > 
> > > > > 
> > > > 
> > > > 
> > > 
> > 
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there a unique method in python to unique a list?

2012-09-08 Thread Donald Stufft
If you don't need to retain order you can just use a set, 

set([1, 1, 2, 3, 4]) = set([1, 2, 3, 4])

But set's don't retain order. 


On Sunday, September 9, 2012 at 1:43 AM, Token Type wrote:

> Is there a unique method in python to unique a list? thanks
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pypi and dependencies

2012-03-20 Thread Donald Stufft
packaging (in 3.3) and distutils2 (2.x-3.2) is a new metadata format for python 
packages. It gets rid of setup.py and it includes a way to specify the 
requirements
that your package needs. This will show up on PyPI/Crate.


On Tuesday, March 20, 2012 at 8:01 AM, Andrea Crotti wrote:

> On 03/20/2012 11:18 AM, Ben Finney wrote:
> > Andrea Crottimailto:andrea.crott...@gmail.com)> 
> > writes:
> > 
> > > When I publish something on Pypi, is there a way to make it fetch the list
> > > of dependencies needed by my project automatically?
> > > 
> > > It would be nice to have it in the Pypi page, without having to look at 
> > > the
> > > actual code..
> > > 
> > 
> > Sadly, no. The metadata available for packages on PyPI does not include
> > information about the dependencies.
> > 
> > (I'd love to be wrong about that, but I'm pretty certain that for most,
> > if not all, packages that's the case.)
> > 
> > > Any other possible solution?
> > All the solutions I've seen involve fetching the full package in order
> > to unpack it and *then* parse it for dependencies.
> > 
> > This is very sub-optimal, and I believe people are working on it; but
> > fixing it will at least require adjustment to all existing packages that
> > don't have dependencies in their metadata.
> > 
> 
> 
> Yes that's not so nice, many projects write clearly the dependencies in 
> the README file,
> but that's annoying because it might get outdated.
> 
> And it's also sad that it's not automatically fetched from setuptools, 
> because it's just
> 
> python setup.py egg-info && cat package.egg-info/requirements.txt
> 
> to actually extract them.
> Should I file a bug maybe or is completely not feasible?
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for PyPi 2.0...

2012-02-15 Thread Donald Stufft
On Wednesday, February 15, 2012 at 4:24 PM, John Nagle wrote:
> On 2/8/2012 9:47 AM, Chris Rebert wrote:
> > On Wed, Feb 8, 2012 at 8:54 AM, Nathan Rice
> > mailto:nathan.alexander.r...@gmail.com)> 
> > wrote:
> > > As a user:
> > > * Finding the right module in PyPi is a pain because there is limited,
> > > low quality semantic information, and there is no code indexing.
> > > 
> > 
> > 
> 
> 
> CPAN does it right. They host the code. (PyPi is just a
> collection of links). They have packaging standards (PyPi
> does not.) CPAN tends not to be full of low-quality modules
> that do roughly the same thing.
> 
> If you want to find a Python module, Google is more useful
> than PyPi.
> 
> 

Hopefully soon crate.io will be useful for finding modules ;) I have plans for 
it to try and, encourage people to host their code and encourage following 
packaging standards. I'm currently focused mostly on the backend stability 
(e.g. getting it stable) but emphasizing things that are generally good for the 
packaging ecosystem is something I hope to do. 
> 
> John Nagle
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
> 

Donald Stufft 
-- 
http://mail.python.org/mailman/listinfo/python-list