pydle
pydle copied to clipboard
Implement user/channel objects
TODO list:
Channels
Data members
Base implementation
- [ ] users: List[str]
- [ ] name: str
rfc 1459
- [ ] modes: Set
- [ ] topic: str
- [ ] topic_by: str
- [ ] created: ???
- [ ] password: str
- [ ] ban_list: List[???]
- [ ] public: bool
Isupport (optionals)
- [ ] exceptionlist : List[???]
- [ ] inviteexceptlist: List[???]
Methods
TBD
Users
data members
Base
- [ ] nickname: str
- [ ] username: str
- [ ] realname: str
- [ ] hostname: str
RFC 1459
- [ ] away: bool
- [ ] away_message: Optional[str]
Account support
- [ ] account: Optional[str]
- [ ] identified: bool
methods
TBD
Original message is as follows:
Currently, users and channels are dicts – they would be better off and less gross as objects.
If you wanted to have fun, but also kill support for anything not Python 3.7, dataclasses would be nice for this.
I believe there is a backport for dataclasses, but would require adding an additional dependency to the project for python versions <3.7.
For the time being, i plan to support Python versions 3.5 or newer, as to give downstream users a bit more leeway on their target python versions.
Also, I will be exploring re-implementing soon.
Given that Pydle suports Python >=3.5 the standard library dataclasses
isn't an option, since it depends on >=3.6 language syntax.
To prevent re-inventing the wheel and thus a LOT of boilerplate, the best course forward for this is probably to use the attrs
package; which retains compatability for older python versions.
I have started work towards this end on my fork, will update if anything substantial comes out of this.