#π how do i annotate this?
28 messages Β· Page 1 of 1 (latest)
@round oar
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
is it that horrible? its just how i define an n state automat
automat = (
((1,), (5,), "-0", True),
((0,), (2,), "+0", True),
((3,), (1,), "-1", False),
((2,), (4,), "+1", False),
((5,), (3,), "-2", False),
((4,), (0,), "+2", False)
)
example input for that arg
the tuples with only 1 number are so i can define undeterministic ones too
Keep in mind in your exampe (1)Β is not a tuple, it's just a number.
ye i just relised
added a , since
This would be a tuple[tuple[int, int, str, bool], ...]
ye i just saw it
deited in the fix
Are those always 1-tuples, or they can have more elements?
the can when the automat is undeterministic
Should be a tuple[tuple[tuple[int, ...], tuple[int, ...], str, bool], ...]it is a very wonky type though
oh so its ...
I'd recommend not using tuples for collections of variable size (unless it's necessary for some reason)
not nesseserry but i thought it cant change so it is best for an arg that gets completle reworked in the init
would help so that i dont accidentaly change it
And using NamedTuples or Dataclasses can help reduce the cognitive load of complex tuples types.
i use this bc this is the way i can understand them
its a table where the 1st coordinate is which node the second is which letter and the collection at the end is which nodes we can go from there
i cant add the str,bool after the ...
what's your current version? still troubles?
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.