Code Monkey home page Code Monkey logo

peps's People

Contributors

1st1 avatar aa-turner avatar akuchling avatar ambv avatar benjaminp avatar birkenfeld avatar brettcannon avatar cam-gerlach avatar dstufft avatar encukou avatar ericsnowcurrently avatar ericvsmith avatar freddrake avatar goodger avatar gvanrossum avatar hugovk avatar jellezijlstra avatar larryhastings avatar loewis avatar mariatta avatar ncoghlan avatar ned-deily avatar nnorwitz avatar pablogsal avatar pitrou avatar rhettinger avatar rosuav avatar tim-one avatar vstinner avatar warsaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

peps's Issues

Confliction about comment style in PEP7

Currently in PEP7, in C dialect section, it first states "C++ style line comments" is among the selected C99 features but then states "Never use C++ style // one-line comments". I think it's a confliction.

Update workflow in PEP 1

PEP 1 needs to be updated to reflect the new GitHub workflow. For example, the following part is now outdated. They can send a pull request on GitHub:

 Updates to existing PEPs also come in to [email protected].  Many PEP
 authors are not Python committers yet, so PEP editors do the commits for them.

Clarify what "public domain" actually means in PEP templates

Most (all?) PEPs include a public domain dedication at the end, but that's not necessarily a concept that consistently applies across different jurisdictions.

For PEP 531, I've amended that part of the PEP to say:

This document has been placed in the public domain under the terms of the CC0 1.0 license: https://creativecommons.org/publicdomain/zero/1.0/

Perhaps we should make that the default text in the PEP template? (We can leave it up to individual PEP authors if they want to clarify the terms on their old PEPs)

Move peps into subdirectory

The root directory listing is currently very long, which means that nobody will see github's readme rendering.

The peps sources could be moved into a subdirectory, separated from the scripts used to generate the rendered versions.

PEP proposal: new file-like object methods

I often find myself writing mixed code like the following.

f = open(filename, 'r+b')
f.write(data)
os.pwrite(f.fileno(), data, offset)
f.flush()
os.fsync(f.fileno())

Essentially the problem is that os module provides more methods than the object returned by open(). I propose that we add or change few methods in IOBase and derived classes to have additional methods:

  • f.readp(offset, bytecount) implemented as os.pread(f.fileno(), bytecount, offset)
  • f.writep(offset, data) implemented as os.pwrite(f.fileno(), data, offset)
  • f.sync() implemented as f.flush() + os.fsync(f.fileno())

Alternatively we could modify existing methods with keyword only arguments. I am not entirely inclined to go this way but it is up to debate:

  • f.read(size, *, offset=None) calling pread when offset is int
  • f.write(data, *, offset=None) calling pwrite when offset is int
  • f.flush(sync=False) calling fsync in addition to what it is doing if told so

For binary files, the implementation is abvious and described above. For text files, either raise NotSupported or count in characters instead of bytes. For in-memory classes sync would do nothing.

Suggestion: use squash commits

Squashing commits makes for a cleaner git history and avoids having authors' micro-commits preserved forever. (If you really want to see what they were thinking, the closed PR will still be preserved for eternity.) This is a sticky option on the Merge button; we can also make the repo always do squash commits through some config option.

Start recommending curly quotes or start using automatic quote conversion

Typography experts agree: Typewriter quotes in non-code text bodies are wrong.1, 2

I gather that PEP editors might not be willing to learn how to input typographically correct quotes.

If this is case, I propose to start using smartypants or similar code to automatically convert typewriter quotes and apostrophes into curly ones. Smartypants works on HTML and skips <code/>, <pre/> and other literal tags.

I would prefer to directly have curly quotes in the rST document, as β€œdirect” is more readable than &ldquo;escaped&rdquo;, while explicit is better than implicit (and smartypants could find false positives, although unlikely).

Is there a pep newline character linter rule?

Hi, my apologies if this has been asked before. But how do I add a linter rule for making sure all files use one newline character? Say, I only want all of my files in the repo to use \n instead of \r\n or \r. Please shed some light. Thanks.

PEP 7: clarify "strongly preferred" braces

Discussion:

Guido Van Rossum's email:

I interpret the PEP as saying that you should use braces everywhere but not
to add them in code that you're not modifying otherwise. (I.e. don't go on
a brace-adding rampage.) If author and reviewer of a PR disagree I would go
with "add braces" since that's clearly the PEP's preference. This is C
code. We should play it safe.

fstring length issue?

time=10000
print(f'{time:025_}')
print(f'{time:025_o}')
print(f'{time:025_b}')
print(f'{time:025_x}')

output:
0_000_000_000_000_010_000
0_0000_0000_0000_0002_3420
0_0000_0010_0111_0001_0000
0_0000_0000_0000_0000_2710

focus on the length.

Error in PEP 542

When assigning a function to an instance, the self parameter should not be included.

> python
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyClass:
...    pass
...
>>> def my_function(self):
...    pass
...
>>> my_instance = MyClass()
>>> my_instance.my_function = my_function
>>> my_instance.my_function()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: my_function() missing 1 required positional argument: 'self'

Does github support of commit squashing meet repo history requirements?

I'm not sure if this repo is the right place to discuss proposed peps, so please let me know if there's a better forum.

In PEP 0512, under the Document steps to commit a pull request section, there is a preference described for one commit for each single change. I'm not exactly clear what this means, but I think this might mean that each merged PR should show up as a single commit, no matter how many commits the developer made while developing the PR.

If that is so, would github's facility to squash commits for PR's meet this requirement? https://help.github.com/articles/about-pull-request-merge-squashing/

Attn @brettcannon

PEP 538: update notes for linux-sig feedback

Notes from the linux-sig thread at: https://mail.python.org/pipermail/linux-sig/2017-January/000014.html

  • change the sense of the environment variable to be an explicit off-switch for the coercion behaviour (PYTHONCOERCECLOCALE=0) rather than being an on-switch for more permissive behaviour
  • add a "--with[out]-c-locale-coercion" configure flag and a related PY_COERCE_C_LOCALE preprocessor definition (for the command line app coercion behaviour)
  • add a "--with[out]-c-locale-warning" configure flag and a related PY_WARN_ON_C_LOCALE preprocessor definition (for the runtime library warning behaviour)
  • in the command line app, check the result of the C.UTF-8 locale coercion, complain if it doesn't work, and then try the en_US.UTF-8 locale. If that still doesn't work, complain again, then continue with the C locale
  • simplify the library warning to:

Python runtime initialized with LC_CTYPE=C (a locale with default ASCII encoding), which may cause Unicode compatibility problems. Using C.UTF-8 as an alternative Unicode-compatible locale is recommended.

Make "Provisional" an explicit PEP status

Provisionally accepted PEPs are currently marked in the PEP repo as simply "Accepted".

This doesn't cause any major problems for CPython, as the only real difference is that the PEP doesn't get marked as Final until the "Provisional" markers get removed from the module documentation.

It's a bit more of an issue for distutils-sig, as our provisionally accepted PEPs may need to be implemented in multiple tools, and the purely informational PEPs may end up going to the Active status rather than to Final the way normal standards track PEPs do.

Having Provisional as a defined state for both Standards Track and Informational PEPs (and updating the PEP 0 listing accordingly) would allow such cases to be handled in a more transparent manner, rather than relying on written notes in the PEP body, or folks having seen the appropriate posts to distutils-sig about it.

Items a PR will need to cover

  • Adding relevant text to PEP 1
  • Updating pep2html.py to handle the new status (no changes needed)
  • Adding a new section to the PEP 0 generator
  • Reviewing the currently accepted PEPs and marking the Provisional ones
  • Reference https://www.pypa.io/en/latest/specifications/#provisional-acceptance for the meaning of provisional in Discussions-to: distutils-sig PEPs (I now feel PEP 1 shouldn't be aware of this level of detail)
  • Reference PEP 411 for the meaning of provisional in other PEPs (I now feel PEP 1 shouldn't be aware of this level of detail)

Host a mirror of the rendered PEPs as GH Pages

Another option compared to Read the Docs is GH Pages where Travis uploads the rendered HTML pages. That way there are rendered copies that are available to view almost immediately instead of waiting for python.org/dev/peps/ to have its cron job to trigger or wait until we get the build process on Sphinx so we can host on Read the Docs.

Pep 440 question/clarification Version specifiers no "Or" available.

I was reading pep 440 and in particular the "Version specifier section".

The following sentence caught my eye:

The comma (",") is equivalent to a logical and operator: a candidate version must match all given version clauses in order to match the specifier as a whole.

Is there no way to have a "or" ? It seem to me that it might be useful for package that want to express compatibility with 2.6, 2.7 or >3.3 for example, in the form =~2.6 <or operator> =~3.3.

I completely agree that the use case is limited and rare, I was just wondering if I'm missing something, if it was an oversight and if not if adding a section detailing that "or" was not considered, or that "or" was explicitly not included for X,Y,Z reason would be a good thing.

Thanks,

Add regular expression example to pep440 ?

I've seen a couple of project getting pep440 "wrong" because they don't want to include a lot of dependencies just to check version number.

The canonical public version identifiers MUST comply with the following scheme:
[N!]N(.N)*[{a|b|rc}N][.postN][.devN]

Is relatively easy to read. Not so to automatically check, especially if you don't read all the sections with the allowed valued of N, and whether there should be dot. If you get a version number wrong, some things can be annoying (like publishing wheels can have a version number that don't match the sdist, ... ) ...

AFAICT the following regex should check whether a version is canonical, doyou think it would be a good idea to give it as an example in pep 440, in order for developers to "just" copy past it ?

'^([1-9]\d*!)?(0|[1-9]\d*)(.(0|[1-9]\d*))((a|b|rc)(0|[1-9]\d))?(.post(0|[1-9]\d*))?(.dev(0|[1-9]\d*))?$'

How does "Knuth's style" for line breaks translate to code?

PEP 8 says the following:

In Python code, it is permissible to break before or after a binary operator, as long as the convention is consistent locally. For new code Knuth's style is suggested.

However, I don't see how Knuth's style applies to code. Knuth's style distinguishes between formulas within paragraphs and displayed formulas. What is the analogous distinction in a coding context?

Do away with the 79 char limit

It makes sense for code to have a line length limit, but not for prose:

When editing a document with manual breaks, lines will either be constantly uneven or you will have to manually reflow whole paragraphs all the time, breaking diffs.

I propose to do one sentence per line, and break after commas in long composite sentences. This will be nice for diffs, and result in no useless manual reflowing.

Add a license

I'm talking to our lawyer to find out what the best license is.

Provide a pull request template

I'm thinking we should have something like the following for all PRs opened on this repo to make sure people don't skip steps:
"""
Please make sure you have completed this checklist before submitting a pull request:

  • Has this idea been proposed on python-ideas and received general acceptance as being an idea worth pursuing? (if not then please start a discussion there before submitting a pull request)
  • Has a draft of this PEP been sent to python-ideas for discussion and proofreading? (if not then we recommend you fork this repository, add your PEP, and then send the PEP as plaintext and a link to your fork so people can send you pull requests for your PEP)
  • Do you have an implementation of your idea? (this is important for when you propose this PEP to python-dev as code maintenance is a critical aspect of all PEP proposals prior to a final decision; in special circumstances an implementation can be deferred)

If the above have all been met then you may submit a pull request here prior to beginning a discussion on the python-dev mailing list.
"""
Basically I want to avoid people send us PEPs prematurely where we shouldn't be acting as copy editors for ideas that can't make it past python-ideas.

Set up Travis to build the peps

That way we can make sure there are no errors.

Not sure if there's a way to make warnings into errors, but if there is then we should do that.

For comparisons, use subclass check, or is?

From the Abstract in the PEP, the comparison functions are given as:

def __eq__(self, other):
    if other.__class__ is self.__class__:
        return (self.name, self.unit_price, self.quantity_on_hand) == (other.name, other.unit_price, other.quantity_on_hand)
    return NotImplemented

There's been discussion on whether this should be a subclass check, or an exact match. I plan on looking in to this and addressing it before the next PEP version. This is a placeholder to remind me, and for discussion.

Use .rst as the file extension for reST-based PEPs

Requires not only renaming all relevant files but also updating code to accept the file extension. As part of this we can probably consider dropping the Content-Type as it will be known from the file extension (although others may disagree).

This will allow for rich rendering of the reST-based PEPS by GitHub.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.