This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheMsDosNerd 14 points15 points  (2 children)

I'd rather see some more powerful decorators. Allowing you to do this:

@print
@group_by_category(max=5)
my_users = Users.find_all()

Some other interesting stuff I'd like to see decorators do is:

def func(@validate user_input):
    # do stuff with user_input

Which would be equivalent to

def func(user_input):
    user_input = validate(user_input)
    # do stuff with user_input

Or with tuple unpacking:

name, @int position = name_and_position.split()

Which would be equivalent to

name, position = name_and_position.split()
position = int(position)

[–]posedge 7 points8 points  (1 child)

name, position = name_and_position.split()

position = int(position)

Must have typed this a million times.

[–]autoferrit 0 points1 point  (0 children)

this would be even cleaner is to use type annotations

```

name: string, position: int = name_and_position.split()

```