Hi all,
I'm happy to announce that a new release of pydoctor, the documentation
extractor used by Twisted, is available on PyPI.
https://pypi.org/project/pydoctor/
Thanks to everyone who contributed with patches and reviews!
Major changes in this release:
- Python 3 support
- Type annotations on attributes are supported when running on Python 3
- Type comments on attributes are supported when running on Python 3.8+
- Type annotations on function definitions are not supported yet
- …
[View More]Undocumented attributes are now included in the output
- Attribute docstrings: a module, class or instance variable can be
documented by a following it up with a docstring
- Improved error reporting: more errors are reported, error messages
include file name and line number
- Dropped support for implicit relative imports
- Explicit relative imports (using "from") no longer cause warnings
- Dropped support for index terms in epytext ("X{}"); this was never
supported in any meaningful capacity, but now the tag is gone
This will be the last release to support Python 2.7 and 3.5: future
releases will require Python 3.6 or later.
Bye,
Maarten
[View Less]
In smb I have a SMBPacketReceiver that inherits from t.i.p.Protocol, it
breaks the incoming TCP stream into logical packets (the analogue of
LineReceiver in line-based protocols).
I then subclass SMBPacketReceiver to SMBProtocol which does a lot of the
"heavy lifting" analyzing incoming packets.
I've been told in code review to use composition instead of inheritance,
which is fine in a general sense but I have difficulty applying to
twisted-specific tasks.
1. how to do Factory.…
[View More]buildProtocol? It has to return a t.i.p.Protocol,
but with composition the Protocol object is a private variable of
SMBPacketReceiver, in turn a private variable of SMBProtocol.
2. what to do instead of overriding Protocol.dataReceived and access
incoming data if not allowed to subclass it?
Now its not that I cant think of workarounds to these two problems, but
they're ugly
Is there some recent twisted code using composition that I can look at?
Ian
[View Less]