Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation
We would check in the resulting image, so any Java dependency would only be for when we update the image. On Wed, Jan 3, 2018, 01:33 Paul Rudin, wrote: > Brett Cannon writes: > > > On Tue, 2 Jan 2018 at 05:25 Yahya Abou 'Imran > b1ysje57in+bqq9rb...@public.gmane.org> wrote: > > > > At the end of the day, I found that plantuml is the most suitable > tool for > > this. > > > > Right, but when I look at http://plantuml.com/ I don't see any open > source > > code to guarantee it will be available in e.g. 5 years. (I really just > see a > > lot of ads around a free Java app). > > I know nothing of this software, but > https://github.com/plantuml/plantuml appears to be the source code, GPL3 > licensed. > > Still, is a java dependency to build the python docs a good idea? > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?
On Wed, Jan 3, 2018 at 8:24 AM, Random832 wrote: > On Sun, Dec 31, 2017, at 00:33, Guido van Rossum wrote: > > I'm not keen on this recommendation. An argument that takes a Set[Foo] > > would mean that in order to specify: > > - no flags: you'd have to pass set() -- you can't use {} since that's an > > empty dict, not an empty set > > Optional[Set[Foo]]? > > > - one flag: you'd have to pass {Foo.BAR} rather than just Foo.BAR > > - two flags: you'd have to pass {Foo.BAR, Foo.BAZ} rather than Foo.BAR | > > Foo.BAZ > > Maybe the flags themselves should be of a type that you can do both with > (i.e. each value is a set containing itself). > That's pretty much what the enum.Flag type does. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?
On Sun, Dec 31, 2017, at 00:33, Guido van Rossum wrote: > I'm not keen on this recommendation. An argument that takes a Set[Foo] > would mean that in order to specify: > - no flags: you'd have to pass set() -- you can't use {} since that's an > empty dict, not an empty set Optional[Set[Foo]]? > - one flag: you'd have to pass {Foo.BAR} rather than just Foo.BAR > - two flags: you'd have to pass {Foo.BAR, Foo.BAZ} rather than Foo.BAR | > Foo.BAZ Maybe the flags themselves should be of a type that you can do both with (i.e. each value is a set containing itself). ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation
Brett Cannon writes: > On Tue, 2 Jan 2018 at 05:25 Yahya Abou 'Imran b1ysje57in+bqq9rb...@public.gmane.org> wrote: > > At the end of the day, I found that plantuml is the most suitable tool for > this. > > Right, but when I look at http://plantuml.com/ I don't see any open source > code to guarantee it will be available in e.g. 5 years. (I really just see a > lot of ads around a free Java app). I know nothing of this software, but https://github.com/plantuml/plantuml appears to be the source code, GPL3 licensed. Still, is a java dependency to build the python docs a good idea? ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add an UML class diagram to the collections.abc module documentation
You can embed plantuml directives in rst, and possibly the code, and use sphinxcontrib-plantuml which at least keeps the diagrams for documentation close to the code. pyplantuml claims to be able to extract the infromation directly from the code, (https://github.com/cb109/pyplantuml), but having tried it it seems a little flaky (and over specific in its dependencies). pyreverse by default produces a .dot file but takes some time to come up with the correct flags. https://github.com/rtfd/readthedocs.org/issues/407 makes interesting reading as well and is also relevant to this thread. On 02/01/2018 21:29, Barry wrote: > After reading this thread I went off and read up about plantuml. > According to its docs it produces dot files that it reandes with graphviz. > So if graphviz will produce svg that part is solved. > > Can you creat the plantuml file automatically from the python code? > > Barry > > On 2 Jan 2018, at 15:26, Yahya Abou 'Imran via Python-ideas > wrote: > >>> Can I suggest that rather than manually producing or tweaking, and later >>> updating, the diagrams it might be better to spend a little time >>> annotating the source code [...] >>> While the diagrams produced might lack the elegance of manually produced >>> ones they would be much more useful as they would always be up to date >>> due to being produced, and updated, automatically. >> >> I think it would be a lot of changes in the source code... >> >> I would like to precise, so everybody can know it, the syntax of a .puml is >> realy simple. For example: >> >> test.puml: >> >> @startuml >> >> hide members >> show methods >> >> abstract class Iterable { >> {abstract} __iter__() >> } >> >> abstract class Iterator { >>{abstract} __next__() >>.. >>__iter__() >> } >> >> Iterable <|-- Iterator >> >> @enduml >> >> Then: >> >> $ plantuml test.puml >> >> And you have test.png I joined. >> >> >> >>> [...] >>> I am attaching the diagram produced for the full inheritance of >>> collections.abc as produced by doxygen/graphviz but I am sure that there >>> are some options that could make this more readable/useful. >>> >>> Steve >> >> It's a blank file that I have... >> >> I've been struggling with those kind of tools these days, and realised that >> it's a lot more work (and pain) than a plain text file. >> >> ___ >> Python-ideas mailing list >> Python-ideas@python.org >> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman%2Flistinfo%2Fpython-ideas&data=02%7C01%7C%7C6d32c06f38af4d40145708d55227e234%7C84df9e7fe9f640afb435%7C1%7C0%7C636505253601685827&sdata=DyrMOxl32rsEHK%2ByWUW9QlvzP%2Fn%2FqHXsKlSNuT%2B0loU%3D&reserved=0 >> Code of Conduct: >> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpython.org%2Fpsf%2Fcodeofconduct%2F&data=02%7C01%7C%7C6d32c06f38af4d40145708d55227e234%7C84df9e7fe9f640afb435%7C1%7C0%7C636505253601685827&sdata=PQTKP%2FYAkdZscYpy815VbJXBeE89K1aslWibFgGf1Ww%3D&reserved=0 > -- Steve (Gadget) Barnes Any opinions in this message are my personal opinions and do not reflect those of my employer. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/