Release Date: 2023-01-19
-
The register functions are backported from v1.0 in development. Examples:
>>> import rejected_peps as rp >>> rp.pep211.PEP 211 >>> rp.register(211, 'product') >>> rp.product.PEP 211 >>> rp.register(211, 'pd') >>> rp.pd.PEP 211 >>> rp.get('pd').PEP 211 >>> rp.unregister('pd') >>> rp.pd Traceback (most recent call last): File "<stdin>", line 1, in <module> ... AttributeError: module 'rejected_peps' has no attribute 'pd' >>> rp.clear_register() >>> rp.product Traceback (most recent call last): File "<stdin>", line 1, in <module> ... AttributeError: module 'rejected_peps' has no attribute 'product'
pep249.apply
is now thread safe.pep349.str
,pep3140.str
andpep349.str & pep3140.str
no longer raiseTypeError
if the argument is a type.
Release Date: 2023-01-05
-
pep3140.str
andpep349.str & pep3140.str
now correctly return the result for any mapping.For example:
>>> from collections import defaultdict as d >>> pep3140.str(d(int, {'1': 2})) {1: 2} # v0.9.5 defaultdict(<class 'int'>, {1: 2}) # v0.9.6
Release Date: 2023-01-04
- Support for Python 3.8 is planned to be dropped on October 14, 2023; if you need extended support, please report it.
pep351.freeze
now detects any sequence or mapping.pep351.freeze(…, allow_frozendict=True)
no longer crashes if thepep416
import fails.
Release Date: 2023-01-04
- Functions in
pep313
are now cached.
Release Date: 2023-01-03
- Fix
test.run()
: it no longer exits when finished and can correctly run the tests in the module. You can override the non-exiting by specifyingexit=True
.
Release Date: 2023-01-03
- Functions in
__init__.py
are now cached.
Release Date: 2023-01-03
- Add tests for
__init__.py
. - Functions in
pep313
now reject 0 ifpep336.isNone(zero)
instead of just checking for the builtinNone
.
Release Date: 2023-01-02
- Remove
search_one
deprecated from v0.5; usesearch.one
instead.
Release Date: 2023-01-01
pep326.Min
,pep326.Max
andpep336.NoneType
can now be hashed.DeprecationWarning
is now changed toerror
;search_one
will be removed in v0.9.
Release Date: 2023-01-01
Happy New Year!
pep326.Min
,pep326.Max
andpep336.NoneType
can now be hashed.DeprecationWarning
is now changed todefault
;search_one
will be removed in v0.9.
Release Date: 2022-12-30
- #7, #9: You can now combine PEPs 204 & 281 and 212 & 281; use
r = pep204 & pep281.range
andindices = pep212.indices & pep281.range
, orrp.pep(204, 212, 281)
to get a namespace withrliteral
for PEP 204 andindices
for PEP 212. You cannot directly combine PEPs 204 and 212.
Release Date: 2022-12-30
- #7, #8: You can now combine PEPs 349 and 3140; use
rp.pep(349, 3140).str
orstr = pep349.str & pep3140.str
to letstr()
usestr()
on items and allow returningbytes
.
Release Date: 2022-12-29
- #6:
pep349.str
is now also a class, supportingisinstance
andissubclass
checks. In these two contexts, it behaves the same asbuiltins.str
only; hence,isinstance('1', pep3140.str)
returnsTrue
. Note thatpep349.str(…)
returns abuiltins.str
orbuiltins.bytes
instance, so it's compatible. - #6:
pep349.str
now accepts thestr(bytes_or_buffer, encoding[, errors])
form; in these cases, it's interpreted as normal.
Release Date: 2022-12-29
pep204
no longer fails when imported ifpep211
is unavailable; however,repr(pep204)
still fails ifpep211
is unavailable.
Release Date: 2022-12-29
-
#5:
pep3140.str
now handles recursive objects correctly by replacing them with…
, just as the builtinstr
does. -
pep3140.str
is now a class, supportingisinstance
andissubclass
checks. In these two contexts, it behaves the same asbuiltins.str
; hence,isinstance('1', pep3140.str)
returnsTrue
. Note thatpep3140.str(…)
returns abuiltins.str
instance, so it's compatible.
Release Date: 2022-12-29
- The order of the check for
__andfunc__
inpep535.cmp
is adjusted; now inA and B
,A.__andfunc__
is checked beforeB.__randfunc__
. - The exception note is now added correctly in Python 3.11 when
AttributeError
is raised during the fallback inpep535.cmp
.
Release Date: 2022-12-29
- Add support of PEP 535 — Rich comparison chaining.
Release Date: 2022-12-29
pep351.freeze
doesn't importpep416
until needed (lazy import).- Improve some error messages.
Release Date: 2022-12-28
- Support for Python 3.6 is officially dropped. The
rejected_peps.pep204
format never worked since module__getattr__
was not added until 3.7, and 3.6 entered EOL on Dec. 23, 2021. Support for Python 3.7 will be dropped starting from Jan. 27, 2023.
Release Date: 2022-12-28
- Tests for PEPs 754 and 3140 are supported.
Release Date: 2022-12-28
pep326.Min
is no longer less than itself;pep326.Max
is no longer greater than itself.
Release Date: 2022-12-28
- Tests for PEPs 204 to 559 are supported. Call
rp.run
to run the test suite.
- Update URLs in
info()
to the newestpeps.python.org
format. - Add
file
parameter topep259.print()
. - Correct the error messages of
pep303.divmod()
. - Fix
pep303.rdivmod()
; the first argument is no longer touched. - Add
PEP
constants to PEPs 259 and 313. - Fix implementation of mode
modern
for 49+ in PEP 313. - The parameter
allow_frozendict
ofpep351.freeze()
is keyword-only. pep294.original(s)
andpep294.underscore(s)
ensure thats
is astr
.
Release Date: 2021-08-22
- Fix a possible
UnboundLocalError
inpep294.apply()
.
to_roman(x)
now checks forx.__index__
before falling back toint(x)
&int(x, 0)
.
Release Date: 2021-08-22
roman()
,to_int()
andzero
deprecated for 5 versions in PEP 313 are removed. They were replaced byto_roman()
,from_roman()
anddefault_zero
in v0.4.1.
Release Date: 2021-08-22
- 3 leading underscores are now accepted in
pep313.large_dict
, e.g.___D
→ 500,000,000,000.
- Correct a typo in the PEP 335 warning message.
- Raise
TypeError
early inprint()
of PEP 259 whenend
is notNone
or astr
to prevent unhelpful messages forstr.startswith
and incorrect usage of non str-subclassstartswith
methods.
Release Date: 2021-08-22
- The PEP 294 implementation is rewritten.
- Importing
pep294
no longer directly sets attributes of thetypes
module. The original behavior is fragile, surprising and requiresimportlib.reload(pep294)
to rerun the code. - Instead, the
apply(module=None, *, rename=pep294.underscore, strict=None)
function is added. 1module
defaults totypes
when it'sNone
, otherwise attributes of it are set.rename
is a function that handles invalid names (i.e. a keyword or not an identifier). For example,LambdaType
is converted tolambda
, which is invalid.rename(name)
returns the new variant.strict
is abool
orNone
. Ifstrict
isNone
, it isFalse
ifrename
ispep294.original
, elseTrue
. If it's true and the new name is not astr
or invalid,TypeError
orValueError
is raised depending on the error.rename
is always called before checking.- This function returns
None
since it is an in-place operation onmodule
.
- The
underscore(s)
,title(s)
andoriginal(s)
functions are for therename
parameter.underscore
appends an underscore (_
) to the name. For example,lambda
→lambda_
. This is the default value.title
is an alias ofstr.title
. For example,lambda
→Lambda
.original
just returns the name unchanged. This is usually used when attributes aren't meant to be accessed by thetypes.x
syntax, butgetattr(types, 'x')
etc.
- Importing
DeprecationWarning
is now issued instead ofWarning
in PEP 335 ifNotImplemented
is returned. This matches the behavior starting from Python 3.9, and allows controlling it without effecting otherWarning
subclasses.- Since it's a singleton,
hash(pep335.NeedOtherOperand)
now returns the hash of it's ID, rather than the fixed value 9223363241139.
- The filter action of
DeprecationWarning
is now turned toalways
since old names inpep313
were deprecated in v0.4.1 and removal is scheduled on v0.6.roman()
,to_int()
andzero
will be removed in v0.6.0 final. Please make sure you use the new namesto_roman()
,from_roman()
anddefault_zero
.
- The Python
DeprecationWarning
is now silenced inpep335
since it's already issued manually. Note thatDeprecationWarning
inNOT(NotImplemented)
is still the builtin one.
Release Date: 2021-08-11
- Add support of PEP 335 — Overloadable Boolean
OperatorsOperator Functions. - The new
search.one
is now preferred oversearch_one
. - Add
search.any
andsearch.one.any
to match titles that contain any of the arguments. The default behavior is still all of them.
Release Date: 2021-08-11
- Rejected-PEPs is now typed! See PEP 484 for more information about typing.
info()
now raisesrejected_peps.UnavailableError
if a PEP is supported but info is unavailable. It is a subclass ofNotImplementedError
andLookupError
, so previous code catchingNotImplementedError
won't break.- Improve some documentation to be clearer.
Release Date: 2021-08-09
- The support of PEP 313 has underwent some major changes.
roman()
is renamed toto_roman()
. The original name is deprecated and will be removed in v0.6.to_int()
is renamed tofrom_roman()
. The original name is deprecated and will be removed in v0.6.zero
is renamed todefault_zero
. The original name is deprecated and will be removed in v0.6.from_roman()
now supports parsing roman fractions.
- A minor cleanup was done for some files (removing unneeded imports etc.).
Release Date: 2021-08-09
- Add support of PEP 313 — Adding Roman Numeral
LiteralsFunctions to Python - Add functions
search(*s, strict=False)
,search_one(*s, strict=True)
andget(*s)
.
Release Date: 2021-08-08
- Add support of:
Release Date: 2021-08-08
- Add support of PEP 281 — Loop Counter Iteration with
range
andxrange
- Add 259 into
SUPPORTED
Release Date: 2021-08-08
- Add support of PEP 259 — Omit printing newline after newline
- Add the missing
PEP
constant inpep204
.
Release Date: 2021-08-08
- Add support of PEP 204 — Range Literals
pep3140.str()
now correctly formats mappings, not justdict
.
Release Date: 2021-08-08
- Add support of PEP 3140 –
str(container)
should callstr(item)
, notrepr(item)
.
Release Date: 2021-08-08
This is the first version guaranteed having no install or import problems in regular environments.
- Fix
dir(rejected_peps)
. - Fix module raising
ValueError
when directly run.
Release Date: 2021-08-08
dir(rejected_peps)
now includes the pep submodule names.
Release Date: 2021-08-08
- Fix submodule not being found.
Release Date: 2021-08-08
- Add support of:
- Fix self-inheriting bug in PEP 276.
Release Date: 2021-08-08
- Fix all installing and importing problems of 0.1.0.
Release Date: 2021-08-08
Initial release!
Footnotes
-
There is a built-in
apply()
function in Python 2.x, but anyway we didn't support 2.x from the start, andapply
is just a name, not a keyword. ↩