pydle icon indicating copy to clipboard operation
pydle copied to clipboard

Implement user/channel objects

Open ghost opened this issue 11 years ago • 3 comments

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.

ghost avatar Feb 15 '14 23:02 ghost

If you wanted to have fun, but also kill support for anything not Python 3.7, dataclasses would be nice for this.

FrozenPigs avatar Dec 27 '18 21:12 FrozenPigs

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.

theunkn0wn1 avatar Dec 27 '18 22:12 theunkn0wn1

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.

theunkn0wn1 avatar Jun 21 '20 18:06 theunkn0wn1