Live data from Hacker News

What’s New in Python 3.7

docs.python.org

11–20 of 70 posts

Re: What’s New in Python 3.7

#11
post #3

"More than 255 arguments can now be passed to a function, and a function can now have more than 255 parameters." There are human devs who needed this? Or is this a sign that AI bots are now involved in language design?

First thing that pops to mind is ORM for extremely column-wide tables, which are not unusual in some domains.

Re: What’s New in Python 3.7

#12
post #6
post #3

"More than 255 arguments can now be passed to a function, and a function can now have more than 255 parameters." There are human devs who needed this? Or is this a sign that AI bots are now involved in language design?

Perhaps it could trigger if you do function(*iterable), with a huge iterable?

Nope, that works just fine.

  >>> def f(*x): print(x[-1])
  >>> f(range(300))
  299
And surprisingly, in python 2.7, I was able to define a function that takes more than 255 arguments. But perhaps this only worked because I cheated and used exec.

  >>> exec("def f(" + ",".join("f" + str(x) for x in range(300)) + "): print(f299)"
  >>> f(*range(300))
  299

Re: What’s New in Python 3.7

#13
post #3

"More than 255 arguments can now be passed to a function, and a function can now have more than 255 parameters." There are human devs who needed this? Or is this a sign that AI bots are now involved in language design?

Dear God why.

Re: What’s New in Python 3.7

#14
post #5
post #2

Switching the default encoding from ASCII to utf-8 sounds like a pretty big change.

Not really, imho. It makes more things work out of the box, but input and output for things that used to be ASCII anyway remain the same.

Are you American? Americans always think that changing the encoding is a minor detail.

Guess what, changing the default encoding breaks every language that is not English.

Re: What’s New in Python 3.7

#15
post #5

Earlier quoted context omitted.

Not really, imho. It makes more things work out of the box, but input and output for things that used to be ASCII anyway remain the same.

Are you American? Americans always think that changing the encoding is a minor detail. Guess what, changing the default encoding breaks every language that is not English.

If it was changed from ascii to utf-8, how does it break everyting else ?

Re: What’s New in Python 3.7

#16
post #2

Switching the default encoding from ASCII to utf-8 sounds like a pretty big change.

Isn't ASCII a strict subset of UTF-8?

If anything this should make sure programs don't break because they read some utf-8 extended character when expecting just ascii -- which is the most common case.

Re: What’s New in Python 3.7

#17
post #3

"More than 255 arguments can now be passed to a function, and a function can now have more than 255 parameters." There are human devs who needed this? Or is this a sign that AI bots are now involved in language design?

First thing that pops to mind is ORM for extremely column-wide tables, which are not unusual in some domains.

I'm not too familiar with Python but something like that would typically be handled by passing a pointer to a data structure containing the column data, and not each column itself (or does/did it have a 255-item limit on its other data structures too...?)

Re: What’s New in Python 3.7

#18
post #3

"More than 255 arguments can now be passed to a function, and a function can now have more than 255 parameters." There are human devs who needed this? Or is this a sign that AI bots are now involved in language design?

On python-dev a few month ago, Guido agreed with you that this is an arbitrary limitation that should be removed at some point. In particular, he worried that programmatically generated code would tend to run into this limitation.[0]

[0]: https://bugs.python.org/msg142998

Re: What’s New in Python 3.7

#19
post #6
post #3

"More than 255 arguments can now be passed to a function, and a function can now have more than 255 parameters." There are human devs who needed this? Or is this a sign that AI bots are now involved in language design?

Perhaps it could trigger if you do function(*iterable), with a huge iterable?

I believe args and *kwargs have special opcodes already.
Post reply on HN