amuse icon indicating copy to clipboard operation
amuse copied to clipboard

Remove keyword collisions

Open rieder opened this issue 7 years ago • 17 comments

Describe the bug amuse/rfi/core.py line 126 defines an "async" function. In Python 3.5+, async is a reserved keyword (https://www.python.org/dev/peps/pep-0492/). We may need to rename this function to prevent "invalid syntax" errors.

rieder avatar Sep 17 '18 16:09 rieder

I don't think its a big problem since the async are class methods?? (there are other collisions in the code..)

ipelupessy avatar Sep 18 '18 08:09 ipelupessy

we can maybe gather those here?

ipelupessy avatar Sep 18 '18 08:09 ipelupessy

we can maybe gather those here?

good idea. I'll rename the issue.

rieder avatar Sep 18 '18 09:09 rieder

new option for async as keyword argument to function calls (#339 )

ipelupessy avatar Nov 23 '18 08:11 ipelupessy

FWIW: the use of async is a definite showstopper for trying to use Amuse with Python 3.7, since it's a reserved keyword as of 3.7.

evertrol avatar Nov 26 '18 12:11 evertrol

ok, asyncawait was introduced in 3.5 and 3.6 but 3.7 makes it reserved..so will change

ipelupessy avatar Nov 26 '18 15:11 ipelupessy

After discussing with Inti, I like the following:

  • change the async function keyword to return_request
  • change the .async() method to .asynchronous()
  • encourage use of the function argument over the method since this allows wrapping the interface function

fjansson avatar Dec 10 '18 14:12 fjansson

sounds good to me.

rieder avatar Dec 10 '18 15:12 rieder

async is fixed (4b48747)

ipelupessy avatar Dec 10 '18 19:12 ipelupessy

other cases (not specific to python 3):

  • object
  • format
  • callable

ipelupessy avatar Jan 22 '19 12:01 ipelupessy

  • set

ipelupessy avatar Jan 22 '19 12:01 ipelupessy

#359 is a duplicate of this issue

rieder avatar Jan 22 '19 12:01 rieder

i think for "object" as used in the interface definitions (define_parameters, define_methods etc ) this can be replaced by "handler" (these instances of amuse.support.interface.HandleParameters etc)

ipelupessy avatar Jan 22 '19 12:01 ipelupessy

yes, that sounds good.

rieder avatar Jan 22 '19 12:01 rieder

  • sum (e.g. in src/amuse/ic/kingmodel.py)

rieder avatar Jan 22 '19 13:01 rieder

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 04 '22 18:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 31 '22 21:05 stale[bot]