Live data from Hacker News

Most popular Python packages now support Python 3

py3readiness.org

81–90 of 166 posts

Re: Most popular Python packages now support Python 3

#81
post #8

Clicking around, those that don't seem to be: 1. Obsolete. Either explicitly so (e.g. Google API) or abandoned, without even a minor/patch release (initools, 2010) or in some cases a code commit (e.g. pathtools, 2012) for five years or more. I suspect that they will never be Py3, the community will just move on to alternatives. 2. Working hard to bring support (e.g. ansible). 3. Part of the graphite ecosystem. If the…

Supervisord isn't open source? What

Re: Most popular Python packages now support Python 3

#83
post #36
post #18

Earlier quoted context omitted.

Sets, if you mean a collection that contains no more than 1 of something, are easy. Use a map with struct{}{} values. If ordering is important, it's ~30 lines of simple code to encase a slice and a map in a struct and define your desired interface. Testing for a key's existence is easy as well. Accessing a map returns two variables--the 1st is the value itself. The 2nd variable is that "exists" variable you're asking…

Testing membership is the easy part of sets. What about subset, superset, union, intersection, difference? So many problems are trivial thanks to sets. I'd sooner give up regex support in python than the set type, that is how useful they are.

If sets are a good match for your problem (and I agree, they tend to be for many common ones), you definitely should use them in Go. Just write the fucking code.

Even if you use the most obvious, naive code to implement fundamental set operation in Go, the resulting program is probably still faster than whatever you're going to write in Python.

In the absolute worst case, you need to generate an extra copy to use with some other type. Mildly annoying for sure, but easily dealt with.

Re: Most popular Python packages now support Python 3

#84
post #65
post #36

Earlier quoted context omitted.

Testing membership is the easy part of sets. What about subset, superset, union, intersection, difference? So many problems are trivial thanks to sets. I'd sooner give up regex support in python than the set type, that is how useful they are.

Yes, the boolean group operations make many otherwise non-trivial problems remarkably easy. That's why I consider sets such a crucial feature.

Could you give some examples please?

Re: Most popular Python packages now support Python 3

#85

Earlier quoted context omitted.

> at this point there is no reason to not use Python 3 for new projects Sure there is: Python 2 isn't going to change on me again. Python 3 might.

Why on earth do people downvote that? I want a language that isn't going to change. Every single other language community seems to understand that, but something about it pisses off Python people.

You're claiming to know the future of Python better than "Python people" know the future of Python.

Python has changed incompatibly once in 26 years, and never plans to do it again, yet you're making it sound like an ongoing pattern. What language are you going to run to that has that kind of track record?

Re: Most popular Python packages now support Python 3

#86

I would like to know if fellow HNers who regularly code in Python are using f-strings and type hints in your production code or otherwise. I often find myself inclined to use type hinting.

I've been writing a lot of python 3.6 lately. f-strings are really helpful and I use them all over the place.

I haven't used type hints yet.

Re: Most popular Python packages now support Python 3

#87
post #47
post #36

Earlier quoted context omitted.

Testing membership is the easy part of sets. What about subset, superset, union, intersection, difference? So many problems are trivial thanks to sets. I'd sooner give up regex support in python than the set type, that is how useful they are.

This repository was named to emphasise the comedy of its existence :) https://github.com/frou/poor-mans-generics/

Ouch!

  type Strings map[string]stdext.Unit
  […]
  func (a Strings) Intersection(b Strings) Strings {
  	result := NewStrings()
  	for as, _ := range a {
  		for bs, _ := range b {
  			if as == bs {
  				result.Add(as)
  				break
  			}
  		}
  	}
  	return result
  }

Re: Most popular Python packages now support Python 3

#88
post #83
post #36

Earlier quoted context omitted.

Testing membership is the easy part of sets. What about subset, superset, union, intersection, difference? So many problems are trivial thanks to sets. I'd sooner give up regex support in python than the set type, that is how useful they are.

If sets are a good match for your problem (and I agree, they tend to be for many common ones), you definitely should use them in Go. Just write the fucking code. Even if you use the most obvious, naive code to implement fundamental set operation in Go, the resulting program is probably still faster than whatever you're going to write in Python. In the absolute worst case, you need to generate an extra copy to use wit…

If a hundred people need to write that code anew a thousand times, somebody's going to screw it up. Widely used and heavily tested code is how we get a more powerful foundation to build on.

If the answer is to generate the Go, then we should be having human beings focus on the more powerful language controlling that generator.

Re: Most popular Python packages now support Python 3

#89
post #14
post #8

Clicking around, those that don't seem to be: 1. Obsolete. Either explicitly so (e.g. Google API) or abandoned, without even a minor/patch release (initools, 2010) or in some cases a code commit (e.g. pathtools, 2012) for five years or more. I suspect that they will never be Py3, the community will just move on to alternatives. 2. Working hard to bring support (e.g. ansible). 3. Part of the graphite ecosystem. If the…

Lack of commit activity doesn't necessarily mean a package is obsolete. A small set of well defined functionality can be "done" at some point and need no further changes.

All software rots because even if the functionality never needs to change, the world (and the APIs) around it will. Some code just rots slower than others.

Re: Most popular Python packages now support Python 3

#90
post #87
post #47

Earlier quoted context omitted.

This repository was named to emphasise the comedy of its existence :) https://github.com/frou/poor-mans-generics/

Ouch! type Strings map[string]stdext.Unit […] func (a Strings) Intersection(b Strings) Strings { result := NewStrings() for as, _ := range a { for bs, _ := range b { if as == bs { result.Add(as) break } } } return result }

Ick, good point. Since the fake set is a map, that should use key lookup?
Post reply on HN