[Checkins] [zopefoundation/zope.schema] 9631fa: Add IFromBytes

GitHub noreply at github.com
Wed Sep 19 16:33:33 CEST 2018


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.schema
  Commit: 9631faaf42465d7bb4a7e89a6ffee4f7dd9c98af
      https://github.com/zopefoundation/zope.schema/commit/9631faaf42465d7bb4a7e89a6ffee4f7dd9c98af
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-09-18 (Tue, 18 Sep 2018)

  Changed paths:
    M CHANGES.rst
    M src/zope/schema/_bootstrapfields.py
    M src/zope/schema/_bootstrapinterfaces.py
    M src/zope/schema/_compat.py
    M src/zope/schema/_field.py
    M src/zope/schema/interfaces.py
    M src/zope/schema/tests/test__bootstrapfields.py
    M src/zope/schema/tests/test__field.py

  Log Message:
  -----------
  Add IFromBytes

As a counterpoint to IFromUnicode.

This is useful when you know the type of data you're dealing with, and conversions are either trivially non-lossy (or will fail anyway) or are not necessary.

The numeric fields as well as Bytes/Line and URI, DottedName and Id implement this, the last three because they are native string lines that want to accept bytes on Python 2 anyway.

On Python 2, lxml likes to produce byte strings "to save memory" even when parsing unicode and given proper XML encoding information, so this can be very helpful there.


  Commit: 246a98a68f30731bf3390ca9db9fae743ebc34d6
      https://github.com/zopefoundation/zope.schema/commit/246a98a68f30731bf3390ca9db9fae743ebc34d6
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-09-18 (Tue, 18 Sep 2018)

  Changed paths:
    M src/zope/schema/_bootstrapfields.py

  Log Message:
  -----------
  Add versionchanged sphinx directive for Bool.


  Commit: b25afd56a1b788528c2f92c5e568ca87205914e8
      https://github.com/zopefoundation/zope.schema/commit/b25afd56a1b788528c2f92c5e568ca87205914e8
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-09-19 (Wed, 19 Sep 2018)

  Changed paths:
    M src/zope/schema/_bootstrapfields.py

  Log Message:
  -----------
  Use separate branches for Number.fromBytes for PY2/3; sprinkle 'no cover' for PY2


  Commit: b5964f548c8ecb87b0c8c3b3b1463cd478a05237
      https://github.com/zopefoundation/zope.schema/commit/b5964f548c8ecb87b0c8c3b3b1463cd478a05237
  Author: Jason Madden <jason+github at nextthought.com>
  Date:   2018-09-19 (Wed, 19 Sep 2018)

  Changed paths:
    M CHANGES.rst
    M src/zope/schema/_bootstrapfields.py
    M src/zope/schema/_bootstrapinterfaces.py
    M src/zope/schema/_compat.py
    M src/zope/schema/_field.py
    M src/zope/schema/interfaces.py
    M src/zope/schema/tests/test__bootstrapfields.py
    M src/zope/schema/tests/test__field.py

  Log Message:
  -----------
  Merge pull request #71 from zopefoundation/feature/IFromBytes

Add IFromBytes


Compare: https://github.com/zopefoundation/zope.schema/compare/7d715edc3184...b5964f548c8e
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the checkins mailing list