Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring typing imports / usage #958

Closed
sveneberth opened this issue Nov 29, 2023 · 4 comments · Fixed by #986
Closed

Refactoring typing imports / usage #958

sveneberth opened this issue Nov 29, 2023 · 4 comments · Fixed by #986
Assignees
Labels
discussion These topics must be discussed before completion idea Priority: Low This issue can be considered with enough idle time. syntax

Comments

@sveneberth
Copy link
Member

sveneberth commented Nov 29, 2023

We have a lot of typing imports like from typing import this, that, ...

Sometimes they are really long:

from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union

I saw in other projects they import typing aliased with t (ìmport typing as t) and write argument: t.Any.
Maybe we should do this in the viur-core too. What do you think, should this be part of our coding conventions?

@sveneberth sveneberth added discussion These topics must be discussed before completion Priority: Low This issue can be considered with enough idle time. idea syntax labels Nov 29, 2023
@ArneGudermann
Copy link
Contributor

I think that's a good idea. Let's do it this way, it's much cleaner.

@sveneberth sveneberth added the viur-meeting Issues to discuss in the next ViUR meeting label Dec 5, 2023
@sveneberth
Copy link
Member Author

sveneberth commented Dec 6, 2023

We should also decide for one task decorator syntax. Currently we have

this (where we import the entire tasks module):

@tasks.CallDeferred

and this (where we import every member of the module):

@CallDeferred

@phorward
Copy link
Member

phorward commented Dec 8, 2023

We should use t for Typing and tasks.* for task-related decorators, but not for standard decorators.

@phorward phorward removed the viur-meeting Issues to discuss in the next ViUR meeting label Jan 3, 2024
phorward added a commit that referenced this issue Jan 9, 2024
Resolve the typing part of #958

---------

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
Co-authored-by: Sven Eberth <mail@sveneberth.de>
phorward added a commit that referenced this issue Jan 9, 2024
Mostly replaced `typing` by `t`
Resolve the typing part of #958

---------

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
Co-authored-by: Sven Eberth <mail@sveneberth.de>
phorward added a commit that referenced this issue Jan 9, 2024
Mostly replaced `typing` by `t`
Resolve the typing part of #958

---------

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
Co-authored-by: Sven Eberth <mail@sveneberth.de>
@phorward
Copy link
Member

phorward commented Jan 9, 2024

fixed by #986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion These topics must be discussed before completion idea Priority: Low This issue can be considered with enough idle time. syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants