Commit Graph

13 Commits

Author SHA1 Message Date
wouter bolsterlee d785c656e5
Clean up some more Python 2-isms (#942)
- Reword and simplify a few docstrings.
- Add back a test for 2-arg super() in property() definitions that
  was (accidentally?) dropped in #936.

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-03-21 15:45:05 +01:00
Hynek Schlawack 29447f81af
Document the various core names and why they exist (#871)
* Document the various core names and why they exist

Signed-off-by: Hynek Schlawack <hs@ox.cx>

* Remove stray backtick

* Add example of new API

* Link PEP 526

* future is now

* phrase and typos

* typo/grammar

* typo

* Better phrasing

* Add missing and

* less words = better

* polish

* phrasing

* looks weird but is correct

* comma spliiiiceeeee

* example

* make it sound less dry

* fix

* phrasing
2021-11-24 09:39:41 +01:00
Tin Tvrtković d7d9c5dde7
Switch to NG APIs in docs (#863)
* Switch to NG APIs in docs

* Review feedback

* Convert examples.rst

* Tweak doctest

* Doctest fixes

* Tweak some more

* Fix

* Update docs/init.rst

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Fix doctest

* Fix README

* Update docs/examples.rst

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Review feedback

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix link

Co-authored-by: Hynek Schlawack <hs@ox.cx>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-22 07:35:36 +01:00
Hynek Schlawack 6aca10f2a7 Beef up glossary and urge people more to read it
Ref #691
2020-09-28 11:27:37 +01:00
Hynek Schlawack b0d2d92787 Clarify __subclasses__ behavior in slotted classes
Ref #691,#407
2020-09-28 11:16:30 +01:00
Hynek Schlawack 82b9e92f25
Explain slots=True and monkeypatching
ref #668

Signed-off-by: Hynek Schlawack <hs@ox.cx>
2020-08-21 08:21:23 +02:00
Hynek Schlawack c67a649b38 Explain that slotted classes don't support multiple inheritance
Fixes #667

Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
2020-08-19 14:37:46 +02:00
Hynek Schlawack 277a5c1d45
Add control to generate __[sg]etstate__ (#642)
* Add control to generate __[sg]etstate__

Pass *getstate_setstate* to attr.s to control the generation.  Mostly
interesting for disabling it in slotted classes.

Fixes #512,#513

* Update glossary.rst
2020-05-11 07:11:24 +02:00
Julian Berman 8824dc26c2 Add default_role for Sphinx. (#571)
* Add default_role for Sphinx.

Fix a bunch of broken refs along the way, which become
errors now via -W if you have default_role set.

In theory you can catch those via sphinx-build -n (i.e.
nitpick mode), which IMHO is a decent idea anyhow, but it's
a longer diff to enable that because it'd involve fixing a
bunch of the places that try to reference types that don't
exist (e.g. :type foo: Any value). But obviously can be done.

Also didn't actually use this anywhere yet (the any role),
but will do so in a follow-up if this is acceptable.

* Remove the roles from builtin objects to demo any.

* Style.

* Add z.i to intersphinx.

Enables the link to z.i.Interface.

* Enable nitpick mode.

Fix the remaining broken links or whitelist them via nitpick_ignore.

* Kill all :func:s.

* Kill all :class:es.

* Kill all :doc:s.

* Kill all :ref:s.

Except one, that probably meant :func:, and which
is a duplicate ref.

* Kill :exc: and :data:.

* Kill :mod:s.

* Kill new explicit refs from the merge.
2019-09-09 15:02:16 +02:00
Anders Huss b5e825dd19 Docs: clarify current behaviour/motivation for `slots=True` and autogeneration of __get/setstate__ (#521)
* clarify current behaviour for slots=True and autogeneration of getstate setstate

* fix glossary rst formatting

* Fix grammar docs/glossary.rst

Co-Authored-By: andhus <andhus@kth.se>
2019-07-20 12:27:09 +02:00
Hynek Schlawack 9c1025b7a7 Be consistent with slotted classes 2019-03-21 09:38:32 -05:00
Kyle Altendorf 7fe111cbe2 T325 weakref with slots (#420)
* Add weakref parameter to attr.s()

#325

* Add weakref to simple_classes() strategy

* Rename changelog file with actual PR (420.change.rst)

* Add test_weakref_does_not_add_a_field()

* Add docstrings to new weakref tests

* Add missing blank line

* Correct weakref handling of __weakref__ attributes or an inherrited slot

* Correct typos and terms

* Rename to weakref_slot

* Parametrize more tests against weakref_slot True/False to expose trouble

* Check if __weakref__ has been inherited via a __dict__

* Correct copy/pasted comment

* Change weakref_slot default to True

* Tidy and correct weakref -> weakref_slot
2018-08-25 09:01:02 +02:00
Hynek Schlawack db7c37eda8
Add glossary & make slotted classes official (#371)
* Add glossary & make slotted classes official

* Add missing import
2018-05-02 07:24:04 +02:00